【发布时间】:2012-12-21 20:01:33
【问题描述】:
我在安装包安装失败后尝试安装 mysql2 gem。 当我跑步时
$ sudo gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
我收到以下错误:
构建原生扩展。这可能需要一段时间... 错误:错误 安装 mysql2: 错误: 无法构建 gem 原生扩展。
/Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config正在检查 rb_thread_blocking_region()... 是的,正在检查 rb_wait_for_single_fd()...是检查mysql.h...是检查 对于 errmsg.h... 是检查 mysqld_error.h... 是创建 生成文件
编译client.c在client.c:1中包含的文件中:在文件中 包含在 ./mysql2_ext.h:8 中:包含在文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:105:37: 错误:“ruby_check_sizeof_long”声明为带有负数的数组 大小 typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1:-1]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 在client.c:1中包含的文件中: 在 ./mysql2_ext.h:8 包含的文件中:在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: 在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:24: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-darwin11.4.2/ruby/config.h:24:21:注意:实例化自:
定义 SIZEOF_LONG 8
^ In file included from client.c:1: In file included from ./mysql2_ext.h:8: In file included from/Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:109:38: 错误:“ruby_check_sizeof_voidp”声明为带有负数的数组 大小 typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == 大小(无效*)? 1:-1]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 在文件中包含 client.c:1:在 ./mysql2_ext.h:8 中包含的文件中:在包含的文件中 从 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: 在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:24: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-darwin11.4.2/ruby/config.h:28:22:注意:实例化自:
定义 SIZEOF_VOIDP 8
^ In file included from client.c:1: In file included from ./mysql2_ext.h:8: In file included from/Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: 在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:1382: 在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/intern.h:34: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/st.h:67:45: 错误:“st_check_for_sizeof_st_index_t”声明为一个数组 负大小 typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1:-1]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 在文件中包括从 client.c:1:在 ./mysql2_ext.h:8 中包含的文件中:在包含的文件中 从 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby.h:32: 在包含的文件中 /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/ruby.h:24: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-darwin11.4.2/ruby/config.h:28:22:注意:实例化自:
定义 SIZEOF_VOIDP 8
^ 3 errors generated. make: *** [client.o] Error 1Gem 文件将继续安装在 /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327/gems/mysql2-0.3.11 检查。结果记录到 /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
$ 哪个红宝石
/Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
$哪里是mysql
/usr/local/bin/mysql
我错过了什么?
【问题讨论】:
-
你安装了哪个mysql版本?
-
我看到很多来自谷歌goo.gl/gm9q5的相同帖子
标签: mysql ruby-on-rails gem bundle mysql2