安装 gem MySQL 失败

安装 gem MySQL 失败

我正在 Amazon AMI 2010.11.1 上安装 mysql gem,遇到了下一个问题:

# gem install  mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

我认为我拥有所有需要的库

# rpm -qa mysql*
mysql-libs-5.1.47-1.2.amzn1.i386
mysql-devel-5.1.47-1.2.amzn1.i386
mysql-5.1.47-1.2.amzn1.i386

# rpm -qa ruby*
ruby-irb-1.8.7.302-1.2.amzn1.noarch
ruby-libs-1.8.7.302-1.2.amzn1.i686
ruby-1.8.7.302-1.2.amzn1.i686
ruby-devel-1.8.7.302-1.2.amzn1.i686
ruby-rdoc-1.8.7.302-1.2.amzn1.noarch

有什么提示吗?

答案1

设置中缺少 gcc。

答案2

您是否已先运行“gem update”和“gem upgrade”?您使用的是什么操作系统?

相关内容