我正在运行OSX 10.7(Lion),最近卸载了MacPorts,因为MySQL无法启动. MySQL(64位)现在正在启动,但现在我无法安装MySQL gem(Rails).我尝试过使用with-mysql-config和ARCHFLAGS选项,两者都没有用.我尝试重新安装Ruby 1.9.3,它也没有改变任何东西.在我认为MySQL 5.0.95可能导致问题之后我正在运行MySQL 5.1.61.这是追溯:
Christy$gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/Christy/.rvm/rubies/ruby-1.9.3-p0/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
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
compiling mysql2_ext.c
compiling result.c
linking shared-object mysql2/mysql2.bundle
ld: file not found: /opt/local/lib/libssl.1.0.0.dylib for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mysql2.bundle] Error 1
我尝试重新安装openssl(认为找不到文件:/opt/local/lib/libssl.1.0.0.dylib可能是因为这个),但它仍然不起作用.我对此很新,所以任何帮助都会非常感激!谢谢!
编辑:/ opt / local / lib /不存在.我不知道为什么它在寻找文件.关于如何将其指向正确位置的任何想法(找到libssl指向/usr/lib/libssl.0.9.8.dylib和/usr/local/Cellar/openssl/0.9.8s/lib/libssl.0.9.8. dylib,以及其他地方)?
解决方法:
LD_LIBRARY_PATH中有一个错误的路径.可以通过运行export LD_LIBRARY_PATH = /usr/local/lib:/usr/lib临时为该shell设置它; gem安装mysql2.
但是,可能建议将定义添加到.bashrc(或其他适当的.shellrc文件)导出LD_LIBRARY_PATH = /usr/local/lib:/usr/lib,以便所有shell都能获得它.
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!