Gem mysql2 与 Mac Snow Leopard 上的 Passenger
我可以在捆绑器中使用 mysql2 建立一个带有“rails s”的简单新 Rails 3 站点。我也有 Passenger,但是使用 mysql2 我得到:
错误消息: dlopen(/Users/riccardotacconi/.rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): 库未加载: libmysql.16.dylib 引用自:/Users/riccardotacconi/.rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle 原因:找不到图像 - /Users/riccardotacconi/.rvm/gems/ ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
有类似的问题,但没有与 Passenger 相关的问题。我认为 Passenger 需要一些环境路径才能正常工作。我使用相同的用户运行 apache,PassengerRuby 与我在 shell 中使用的相同,并且运行“rails s”
I can a simple new Rails 3 site with 'rails s' using mysql2 in bundler. I have Passenger too but with mysql2 I get:
Error message:
dlopen(/Users/riccardotacconi/.rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysql.16.dylib Referenced from: /Users/riccardotacconi/.rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle Reason: image not found - /Users/riccardotacconi/.rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
There are similar questions but none with Passenger. I think Passenger needs some environment path to work fine. I run apache with my same user and PassengerRuby is the same as the one I use in the shell and I run 'rails s'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来它无法从您的系统中获取 mysql 库。
您可以使用brew来安装它们。
在绝大多数情况下,最好使用brew 包而不是dmg 包。
如果您需要安装所有这些命令的 bash 命令列表(rvm + Passenger + ruby with mysql),您可以在这里找到它:http://www.glebm.com/2012/01/mac-os-x-ruby-19x-with-rvm-passenger .html
您需要执行 gem uninstall mysql2 然后再次捆绑以确保它不会获取缓存版本。
Looks like it can't pick up mysql libraries from your system.
You can use brew to install them.
In the vast majority of cases it's better to use brew stuff as opposed to dmg packages.
If you need a list of bash commands for installing all that (rvm + passenger + ruby with mysql), you can find it here: http://www.glebm.com/2012/01/mac-os-x-ruby-19x-with-rvm-passenger.html
You'll need to do gem uninstall mysql2 and then bundle again to make sure it doesn't pick up the cached version.