2011-12-17 266 views
0

我在安装MySQL的宝石麻烦:安装MySQL宝石红宝石

gem install mysql 

Fetching: mysql-2.8.1.gem (100%) 
Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
ERROR: Failed to build gem native extension. 

    /home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for mysql_query() in -lmysqlclient... no 
checking for main() in -lm... yes 
checking for mysql_query() in -lmysqlclient... no 
checking for main() in -lz... yes 
checking for mysql_query() in -lmysqlclient... no 
checking for main() in -lsocket... no 
checking for mysql_query() in -lmysqlclient... no 
checking for main() in -lnsl... yes 
checking for mysql_query() in -lmysqlclient... no 
checking for main() in -lmygcc... no 
checking for mysql_query() in -lmysqlclient... no 
*** 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=/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 
--with-mysql-config 
--without-mysql-config 
--with-mysql-dir 
--without-mysql-dir 
--with-mysql-include 
--without-mysql-include=${mysql-dir}/include 
--with-mysql-lib 
--without-mysql-lib=${mysql-dir}/lib 
--with-mysqlclientlib 
--without-mysqlclientlib 
--with-mlib 
--without-mlib 
--with-mysqlclientlib 
--without-mysqlclientlib 
--with-zlib 
--without-zlib 
--with-mysqlclientlib 
--without-mysqlclientlib 
--with-socketlib 
--without-socketlib 
--with-mysqlclientlib 
--without-mysqlclientlib 
--with-nsllib 
--without-nsllib 
--with-mysqlclientlib 
--without-mysqlclientlib 
--with-mygcclib 
--without-mygcclib 
--with-mysqlclientlib 
--without-mysqlclientlib 

的mkmf.log文件由GCC调试输出是没有帮助的,以我的堆的,我可以张贴,但我敢打赌它像上面提到的配置选项一样更加微不足道。

有没有人在Ubuntu1104系统上获得过这方面的经验?

感谢任何提示!

干杯, 的Mac

+0

可能重复[安装mysql2 gem for Rails 3](http://stackoverflow.com/questions/3608287/installing-mysql2-gem-for-rails-3) – 2011-12-18 07:48:42

回答

1

显然你还没有安装MySQL的开发库需要编译这个宝石。 libmysqlclient-dev可能会有所帮助。

+0

每天至少有一个关于这个问题的问题? – djd 2011-12-17 11:47:08