Ruby On Rails 3 和 Webrick 问题 [英] Ruby On Rails 3 and Webrick issue
问题描述
感谢您查看此内容.
我通过 lynda.com 开始了有关 RoR 的初学者教程.我按照信中的说明进行操作.到目前为止一切正常,直到我开始访问 Webrick.当我输入rails server"开始工作时,我收到以下错误消息.
I started a beginner's tutorial on RoR through lynda.com. I followed the instructions to the letter. Everything was working so far until I got to accessing Webrick. When I typed in "rails server" to begin work, I got this error message below.
/Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2.rb:8
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
from /Users/macuser/Sites/simplecms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:28:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:28
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:27:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
我正在使用
- iMac
- 红宝石 1.87
- 宝石 1.7.2
由于我对 Ruby 没有任何经验,所以我不知道如何解决这个问题.
Since I'm not experienced with anything Ruby, I'm lost on how to fix this.
提前感谢您的关注和可能的帮助.
Thanks in advance for your attention and help if possible.
推荐答案
在终端运行这些:
gem install bundler
bundle
然后你应该可以启动服务器了.
And then you should be able to boot the server.
编辑:您真的应该考虑使用 rvm 来管理您的 ruby 安装和宝石.安装它们也会为您节省大量时间和精力.
Edit: You should really look into using rvm to manage your ruby installs and gemsets. It'll save you a lot of time and effort in installing them too.
这篇关于Ruby On Rails 3 和 Webrick 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!