1

レールを越えてアプリの下にいるとき。そして私はします:

$ bundle install

このエラーを取得します:

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>'

プログラムは正しいですが、/ usr / local / mysql-5.5.13-osx10.6-x86_64 / bin/mysql_configが存在しないためです。存在するものは次のとおりです。

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

そして私がそうするなら:

$: 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

どうやらそれは警告だけです。

これを永遠に修正するにはどうすればよいですか?みなさん、ありがとうございました!

4

1 に答える 1

0

シンボリックリンクを作成しました

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

これは完全な解決策ではありませんが、機能します。

于 2011-10-15T12:54:43.017 に答える