简体   繁体   English

安装问题:Mac OS X Lion + Ruby 3上的mysql2

[英]Problems installing: mysql2 on Mac OS X Lion + Ruby 3

when i'm under my app over rails. 当我在我的应用程序下通过rails。 and i do: 我做:

$ bundle install

I retrieve this error: 我检索到此错误:

Installing mysql2 (0.2.7) with native extensions /Users/workdreamer/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /Users/workdreamer/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql-5.5.13-osx10.6-x86_64/bin/mysql_config
checking for rb_thread_blocking_region()... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/workdreamer/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
    --with-mysql-config
extconf.rb:32:in ``': No such file or directory - /usr/local/mysql-5.5.13-osx10.6-x86_64/bin/mysql_config --cflags (Errno::ENOENT)
    from extconf.rb:32:in `<main>'

Ok, the program is right but because /usr/local/mysql-5.5.13-osx10.6-x86_64/bin/mysql_config doesn't exist. 好的,该程序是正确的,但是因为/usr/local/mysql-5.5.13-osx10.6-x86_64/bin/mysql_config不存在。 What exist is: 存在的是:

$: cd /usr/local/mysql
mysql/                    mysql-5.5.16-osx10.6-x86/ 

And if i do: 如果我这样做:

$: gem install mysql2
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.7
1 gem installed
Installing ri documentation for mysql2-0.3.7...
Enclosing class/module 'mMysql2' for class Client not known
Building YARD (yri) index for mysql2-0.3.7...
Installing RDoc documentation for mysql2-0.3.7...
Enclosing class/module 'mMysql2' for class Client not known

Apparently it's only warnings. 显然,这只是警告。

What can i do to fix this for ever? 我该怎么做才能永远解决此问题? Thank you everybody! 谢谢大家!

I've created a symlink 我创建了一个符号链接

ln -s /usr/local/mysql/mysql-5.5.16-osx10.6-x86/ /usr/local/mysql-5.5.13-osx10.6-x86_64

It's not a perfect solution but it works. 这不是一个完美的解决方案,但可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM