我已经将雪豹的Rails 3更新了.以前我使用sqlite进行开发.
当我耙db:create时,它工作正常.
现在,我正在尝试在Mac上安装mysql.
>我下载了MysqL-5.1.50-osx10.6-x86.dmg
>已安装所有三个文件.(MysqL- {version} -osx10.5-x86.pkg,MySQL.prefPane,MySQLStartupItem.pkg)
>执行此命令以安装gem.
sudo env ARCHFLAGS="-arch i386" gem install MysqL -- \ --with-MysqL-dir=/usr/local/MysqL --with-MysqL-lib=/usr/local/MysqL/lib \ --with-MysqL-include=/usr/local/MysqL/include
万事皆安.创建的宝石没有错误.
我用创建新项目
rails new p1 -d MysqL
与..一起处理
rake db:create
表明
Could not find gem 'MysqL2 (>= 0,runtime)' in any of the gem sources. Try running `bundle install`.
然后我安装新的宝石. sudo gem安装MysqL2.
同样的问题.我有
dyld: lazy symbol binding Failed: Symbol not found: _MysqL_init Referenced from: /Library/Ruby/Gems/1.8/gems/MysqL2-0.2.3/lib/MysqL2/MysqL2.bundle Expected in: flat namespace dyld: Symbol not found: _MysqL_init Referenced from: /Library/Ruby/Gems/1.8/gems/MysqL2-0.2.3/lib/MysqL2/MysqL2.bundle Expected in: flat namespace Trace/BPT trap
我删除了重复的MysqL2.bundle.结果是一样的.错误.
是因为我在雪豹上安装了32位MysqL吗?还是我的ruby问题?
为什么Rails 3突然要求MysqL2 gem,因为我使用的是-d MysqL.
Mac上的Rails 3 MysqL
谢谢.祝你今天愉快.
最佳答案
滑轨已切换到mysql2,请参阅wycat’s blog.