0

私はstackoverflowに関する複数の質問に目を通しましたが、それらはすべて問題に対して異なる解決策を示しました。Rails プロジェクトを git clone し、bundle install を実行し、1.9.3 ruby​​ を使用して rvm に新しい gemset を作成しました。また、Rails 3.2.13 も bundle install コマンドでインストールされると考えました。過去に、このガイドを使用してこの問題を解決しました. user/local に mysql フォルダーが見つかりませんでした。ガイドには、mysql.h の欠落の問題を解決するには、ファイルを編集していくつかの行を削除する必要があると書かれていました。このファイルはもう存在しませんか? 私はそれを見つけることができませんでしたか?多分私は依存関係を欠いているかもしれませんが、これらの依存関係の Linux インストール方法を見つけましたか? 最新バージョンの代わりに mysql5.5 をインストールする必要があるかもしれませんが、それを指定する方法がわかりませんか? これらのどれが私のためにこれを解決しますか?

Installing mysql2 (0.3.11) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** 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
    --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/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /Users/judyngai/.rvm/gems/ruby-1.9.3-p429@spreeversion    /gems/mysql2-0.3.11 for inspection.
Results logged to /Users/judyngai/.rvm/gems/ruby-1.9.3-p429@spreeversion/gems/mysql2-0.3.11/ext/mysql2/gem_make.out

An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
4

1 に答える 1

1

.hbundle / gem がネイティブの mysql 拡張機能をビルドする前に、最初に mysql 開発ヘッダー (したがって、ファイル拡張子)を設定する必要があります。どのOSを使用していますか? だから私は私の答えを拡張することができます...

たとえば、debian では次のようになりますapt-get install libmysqlclient-dev(他のシステムでは、のように別の名前が付けられる場合がありますmysql-devel)。OSX を使用している場合は、バンドル インストールの問題に関する非常に有益な回答があります。Windowsの場合、これが役立つ場合があります:mysql.h が見つからず、 mysql-devel を見つけようとしています

于 2013-07-11T19:39:13.640 に答える