在fedora 16中安装mysql和mysql2 gem失败了

时间:2013-01-23 02:26:03

标签: mysql ruby gem

这是我的命令信息:

[root@Lil 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

当我输入命令“gem install mysql2”时,信息是:

[root@Lil 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)

我尝试了很多方法,但仍然无法解决问题,我该怎么办?

1 个答案:

答案 0 :(得分: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提示符)

我已经通过yum安装了'mysql-devel'。安装mysql2时的总信息是:[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 ..... 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时:在搜索-lz / usr / bin / ld时跳过不兼容的/usr/lib/libz.so:找不到-lz

将zlib升级到最新版本。

是啊!〜宝石安装成功!认为你hd1!