2013-01-23 81 views
2

這是我的命令信息:安裝mysql和mysql2寶石失敗的fedora16

[[email protected] lib]# gem install mysql -- --with-mysql-config=/usr/bin/mysql_config 
Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
    ERROR: Failed to build gem native extension. 
     /usr/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config 
checking for mysql_ssl_set()... no 
checking for rb_str_set_len()... no 
checking for rb_thread_start_timer()... no 
checking for mysql.h... yes 
creating Makefile 

,當我輸入命令 「創業板安裝mysql2」,該信息是:

[[email protected] lib]# gem install mysql2 
Building native extensions. This could take a while... 
ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 
     /usr/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... no 
checking for rb_wait_for_single_fd()... no 
checking for mysql.h... yes 
checking for errmsg.h... yes 
checking for mysqld_error.h... yes 
creating Makefile 
**this is my gem list:** 
*** LOCAL GEMS *** 
actionmailer (3.2.11) 
actionpack (3.2.11) 
activemodel (3.2.11) 
activerecord (3.2.11) 
activeresource (3.2.11) 
activesupport (3.2.11) 
arel (3.0.2) 
builder (3.0.4) 
bundler (1.2.3) 
cgi_multipart_eof_fix (2.5.0) 
daemons (1.1.9) 
erubis (2.7.0) 
execjs (1.4.0) 
fastthread (1.0.7) 
gem_plugin (0.2.3) 
hike (1.2.1) 
i18n (0.6.1) 
journey (1.0.4) 
json (1.7.6) 
libv8 (3.11.8.13 x86_64-linux) 
mail (2.4.4) 
mime-types (1.19) 
mongrel (1.1.5) 
mongrel_cluster (1.0.5) 
multi_json (1.5.0) 
polyglot (0.3.3) 
rack (1.4.4) 
rack-cache (1.2) 
rack-ssl (1.3.2) 
rack-test (0.6.2) 
rails (3.2.11) 
railties (3.2.11) 
rake (10.0.3) 
rdoc (3.12) 
ref (1.0.2) 
sprockets (2.2.2) 
sqlite3 (1.3.7) 
sqlite3-ruby (1.3.3) 
therubyracer (0.11.3) 
thor (0.16.0) 
tilt (1.3.3) 
treetop (1.4.12) 
tzinfo (0.3.35) 

我嘗試了很多方法,但仍然無法解決問題,我應該怎麼做?

+0

我建議你的平臺使用[package](http://rpmfind.net/linux/rpm2html/search.php?query=ruby-mysql)。 – hd1

+0

我剛剛嘗試過,但它沒有工作~~認爲! –

+0

錯誤是什麼? – hd1

回答

0

[root @ Lil zhanlgei]#gem install mysql2構建原生擴展。這可能需要一段時間...錯誤:安裝mysql2時出錯:錯誤:無法構建gem本機擴展。/usr/bin/ruby​​ extconf.rb檢查rb_thread_blocking_region()...沒有檢查rb_wait_for_single_fd()...沒有檢查mysql.h ...是檢查errmsg.h ...是檢查mysqld_error.h ...是創建Makefile

您是否安裝了mysql開發包?把整個構建日誌(包括所有的東西一直到下一個shell提示符)

我已經安裝'mysql-devel'by yum.the安裝mysql2時的總信息是:[root @ Lil zhanlgei]#gem install mysql2 Build native擴展。這可能需要一段時間...錯誤:安裝mysql2時出錯:錯誤:無法構建gem本機擴展。/usr/bin/ruby​​ extconf.rb檢查rb_thread_blocking_region()...沒有檢查rb_wait_for_single_fd()...沒有檢查mysql.h ...是檢查errmsg.h ...是檢查mysqld_error.h ...是創建Makefile ..... gcc -shared -o mysql2.so mysql2_ext.o client.o result.o -L。 -L/usr/lib64 -L。 -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,-rpath,/ usr/lib64/mysql -lruby -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lpthread -lrt -ldl -lcrypt -lm -lc/usr/bin/ld:跳過不兼容/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../ .. /libz.so搜索-lz/usr/bin/ld時:跳過不兼容的/usr/lib/libz.so當搜索-lz/usr/bin/ld時:找不到-lz

將zlib升級到最新版本。

耶〜〜寶石裝成功!認爲你HD1!