升级到Snow Leopard后的MySQL gem问题
作者:互联网
刚刚升级到雪豹.经过一番混乱之后,我设法启动并运行了MySQL.
现在,我正在尝试使我的Rails环境正常工作.对于一个项目,我正在使用Rails 3.0.3和Ruby 1.8.7
我已经使用以下命令安装了MySQL2 gem:
sudo gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
当我启动Rails服务器时,出现以下错误:
/Users/lee/.rvm/gems/ruby-1.8.7-head/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Users/lee/.rvm/gems/ruby-1.8.7-head/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/lee/.rvm/gems/ruby-1.8.7-head/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: mach-o, but wrong architecture - /Users/lee/.rvm/gems/ruby-1.8.7-head/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Users/lee/.rvm/gems/ruby-1.8.7-head/gems/mysql2-0.2.6/lib/mysql2.rb:7
有没有人遇到过类似的问题,并且知道如何解决此问题?
我比设计师更像是设计师,所以这不是我的强项.感谢任何指针.
解决方法:
卸载/删除所有rvm,ruby和rails实例,然后按照此指南进行全新安装:
http://www.cowboycoded.com/2010/12/04/setting-up-rails-3-on-mac-osx-snow-leopard-10-6-4/
一切正常.哎呀!
同时也将MySQL降级,因此不确定是否会影响最终结果.
标签:gem,osx-snow-leopard,ruby,ruby-on-rails,mysql 来源: https://codeday.me/bug/20191208/2094663.html