1
當我試圖用下面的命令 安裝寶石DM-mysql的適配器:了「未定義的方法'分裂'」安裝寶石DM-mysql的適配器
gem install dm-mysql-adapter -- --with-mysql-config=/usr/bin/mysql
--with-mysql-lib=/usr/lib/mysql
,得到了這樣的結果:
Building native extensions. This could take a while... ERROR: Error installing dm-mysql-adapter: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql --with-mysql-lib=/usr/lib/mysql *** 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=/usr/local/bin/ruby --with-mysql-config extconf.rb:43:in `': undefined method `split' for nil:NilClass (NoMethodError) Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/do_mysql-0.10.2 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/do_mysql-0.10.2/ext/do_mysql/gem_make.out
有沒有人遇到同樣的問題?我應該怎麼做才能解決這個問題? 謝謝!
非常感謝!我一直在嘗試使用上面的參數來安裝它,比如@Deche,並且遇到了同樣的錯誤,你的解決方案工作正常 - 但這很令人驚訝,因爲mysql應該已經在我的PATH中了:/ – 2011-08-08 00:08:04
我有同樣的錯誤。 在我的情況下,通過源代碼編譯安裝mysql。 此解決方案工作正常。 分OS機器.bashrc放PATH和gem install工作。 – seapy 2011-09-29 06:19:40