1

配置:

  • OS X 狮子 10.7.5
  • 通过 xcode462_cltools_10_76938260a.dmg 安装的 XCode 命令行工具
  • MySQL 通过 mysql-5.6.12-osx10.7-x86_64.dmg 安装
  • ruby-1.9.3-p327 通过 rvm

发射:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib   --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config

结果是:

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

        /Users/edo/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile

make
compiling client.c
In file included from client.c:1:
In file included from ./mysql2_ext.h:8:
In file included from /Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32:
/Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:105:37: error: 'ruby_check_sizeof_long' declared as an array with a negative size
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/edo/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-darwin11.4.2/ruby/config.h:24:21: note: expanded from macro 'SIZEOF_LONG'
#define SIZEOF_LONG 8

和更多。

有什么建议吗?

4

0 回答 0