尝试将数据库从 sqlite 更改为 mysql 时,rails 3 mysql2 gem 不起作用
我已将database.yml更新为:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: dreamcity
pool: 5
username: root
password: root
host: localhost
socket: /var/mysql/mysql.sock
我现在可以通过键入以下内容打开mysql:rails dbconsole。但是当我尝试 rake db:schema:load 或 rake db:reset 时,rails 抱怨:
dyld:惰性符号绑定失败:找不到符号:_mysql_init 引用自:/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle 预期在:平面命名空间 dyld:找不到符号:_mysql_init 引用自:/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle 预期在:平面命名空间
有什么问题吗?我已将 mysql2 包含在 Gemfile 中并执行捆绑安装。其他一切都很好...
I have update the database.yml to:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: dreamcity
pool: 5
username: root
password: root
host: localhost
socket: /var/mysql/mysql.sock
I can open mysql by key in: rails dbconsole now. But when I try rake db:schema:load or rake db:reset, rails complains:
dyld: lazy symbol binding failed: Symbol not found: _mysql_init Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/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.6/lib/mysql2/mysql2.bundle Expected in: flat namespace
What's the problem? I have included mysql2 in Gemfile and perform bundle install. Everything else is fine...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论