mysql– 无法启动rails服务器

mysql– 无法启动rails服务器,第1张

概述我已经安装了rails和mysql.我也安装了mysql2 gem.我通过命令创建了一个rails应用程序 rails new try_cms -d mysql 它创建成功.但是当我尝试使用rails server命令运行WEBrick服务器时,我收到以下错误./Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysq

我已经安装了rails和mysql.我也安装了mysql2 gem.我通过命令创建了一个rails应用程序
 rails new try_CMS -d MysqL
 它创建成功.但是当我尝试使用rails server命令运行WEBrick服务器时,我收到以下错误.

/library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2/MysqL2.bundle: dlopen(/library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2/MysqL2.bundle,9): library not loaded: libMysqLclIEnt.16.dylib (LoadError)  Referenced from: /library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2/MysqL2.bundle  Reason: image not found - /library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2/MysqL2.bundle    from /library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2.rb:7    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `each'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `require'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `each'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `require'    from /library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler.rb:114:in `require'    from /Users/dilippednekar/Sites/try_CMS/config/application.rb:7    from /library/Ruby/Gems/1.8/gems/railtIEs-3.0.3/lib/rails/commands.rb:28:in `require'    from /library/Ruby/Gems/1.8/gems/railtIEs-3.0.3/lib/rails/commands.rb:28    from /library/Ruby/Gems/1.8/gems/railtIEs-3.0.3/lib/rails/commands.rb:27:in `tap'    from /library/Ruby/Gems/1.8/gems/railtIEs-3.0.3/lib/rails/commands.rb:27    from script/rails:6:in `require'    from script/rails:6

提前致谢.最佳答案试试这个(见类似问题here)

sudo install_name_tool -change libMysqLclIEnt.16.dylib /usr/local/MysqL/lib/libMysqLclIEnt.16.dylib /library/Ruby/Gems/1.8/gems/MysqL2-0.2.6/lib/MysqL2/MysqL2.bundle
总结

以上是内存溢出为你收集整理的mysql – 无法启动rails服务器全部内容,希望文章能够帮你解决mysql – 无法启动rails服务器所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1167537.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存