Gem installation ERROR: Failed to build gem native extension

I have latest Xcode Tools 3.2.4 installed. Just whenever I try to install any gem, for example, the MySQL gem, such error occurs:

VNMB:rails2app ABC$ sudo env ARCHFLAGS="-arch i386" gem install mysql --

--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include Password: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.

/Users/ABC/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include 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... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lmygcc... yes checking for mysql_query() in -lmysqlclient... no

Gem files will remain installed in /Users/ABC/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /Users/ABC/.rvm/gems/ruby-1.8.7-p302/gems/mysql-2.8.1/ext/mysql_api/gem_make.out


尝试从macports / homebrew安装mysql。

链接地址: http://www.djcxy.com/p/33238.html

上一篇: Ruby gem mysql2安装失败

下一篇: 宝石安装错误:无法构建宝石原生扩展