这是他在
~/.bashrc
中的路径声明:PATH=/usr/local/bin:$PATH:$HOME/.rvm/bin:/usr/local/mysql/bin # Add RVM to PATH for scripting
符号链接:
Diego-Blantons-MacBook-Pro-3:~ lmrunner07$ sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
Password:
尝试安装 gem:
Diego-Blantons-MacBook-Pro-3:~ lmrunner07$ gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
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 /Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby.h:32,
from ./mysql2_ext.h:8,
from client.c:1:
/Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:105: error: size of array ‘ruby_check_sizeof_long’ is negative
/Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:109: error: size of array ‘ruby_check_sizeof_voidp’ is negative
In file included from /Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:34,
from /Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:1382,
from /Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby.h:32,
from ./mysql2_ext.h:8,
from client.c:1:
/Users/lmrunner07/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/st.h:67: error: size of array ‘st_check_for_sizeof_st_index_t’ is negative
client.c: In function ‘rb_raise_mysql2_error’:
client.c:98: warning: ISO C90 forbids mixed declarations and code
client.c: In function ‘rb_mysql_client_socket’:
client.c:590: warning: ISO C90 forbids mixed declarations and code
make: *** [client.o] Error 1
Gem files will remain installed in /Users/lmrunner07/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/lmrunner07/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
我已经删除了通过homebrew安装的mysql,以及启动代理。 同时rm -rf
了gem目录(Users/lmrunner07/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11)。
rvm implode
命令,然后删除~/.rvm
目录。但是还是没有解决问题。不过还是谢谢你的建议。 - Tyler DeWitt