我试图约3-4小时,试图让MySQL的宝石安装在雪豹红宝石1.9.1。 MySQL的宝石使用前我升级到雪豹的工作就好了1.9.1。 我卸载MySQL服务器和宝石从我的机器。 然后我下载并安装的:mysql-5.1.37-osx10.5-x86_64.dmg。 我已经能够断言我安装这个新版本是为运行64位应用程序。
我卸载MySQL的宝石。 当我试图用这个命令安装gem:
env ARCHFLAGS="-arch x86_64" gem install mysql --verbose -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
我得到这个错误:
GET 304 Not Modified: http://gems.rubyforge.org/latest_specs.4.8.gz GET 200 OK: http://gems.github.com/latest_specs.4.8.gz Installing gem mysql-2.8.1 /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/COPYING /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/COPYING.ja /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/History.txt /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/Manifest.txt /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/README.txt /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/Rakefile /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/ext/mysql_api/extconf.rb /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/ext/mysql_api/mysql.c /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/extra/README.html /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/extra/README_ja.html /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/extra/tommy.css /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/lib/mysql.rb /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/tasks/gem.rake /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/tasks/native.rake /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/tasks/vendor_mysql.rake /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/test/test_mysql.rb Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /Users/sean/.rvm/ruby-1.9.1-p243/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config checking for mysql_ssl_set()... yes checking for rb_str_set_len()... no checking for rb_thread_start_timer()... no checking for mysql.h... yes creating Makefile make gcc -I. -I/Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/i386-darwin9.8.0 -I/Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/backward -I/Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/mysql/include -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -fno-common -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o mysql.o -c mysql.c In file included from /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby.h:32, from mysql.c:5: /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/ruby.h: In function 'INT2NUM': /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/ruby.h:464: warning: comparison is always true due to limited range of data type /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/ruby.h:464: warning: comparison is always true due to limited range of data type /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/ruby.h: In function 'UINT2NUM': /Users/sean/.rvm/ruby-1.9.1-p243/include/ruby-1.9.1/ruby/ruby.h:472: warning: comparison is always true due to limited range of data type mysql.c: In function 'escape_string': mysql.c:290: error: lvalue required as left operand of assignment mysql.c:290: error: lvalue required as left operand of assignment mysql.c: In function 'real_escape_string': mysql.c:434: error: lvalue required as left operand of assignment mysql.c:434: error: lvalue required as left operand of assignment make: *** [mysql.o] Error 1 Gem files will remain installed in /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1 for inspection. Results logged to /Users/sean/.gem/ruby/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
我已经试过各种我从以下链接阅读。
- http://void-design.net/2009/08/05/ruby-191-mysql-and-a-snow-leopard/
- http://www.schmidp.com/2009/06/14/rubyrails-and-mysql-on-snow-leopard-10a380/
- Rails中,MySQL和雪豹
有任何想法吗?