安装 webrick / mogrel 或任何其他 Rails 3 服务器时出现问题

发布于 2024-11-08 01:48:50 字数 2146 浏览 3 评论 0原文

我尝试了各种从终端部署 WEBrick 和 mongrel 的安装方法。当我输入rails server命令时,我得到以下信息:

Toran1$ rails server
/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `require': dlopen(/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `<top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `each'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `each'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler.rb:120:in `require'
    from /Users/Toran1/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我已经在本地和根级别安装了gem,并且在发出命令之前我还导航到了应用程序文件夹。任何帮助将不胜感激!

I have tried various installation methods for deploying a WEBrick and mongrel from the terminal. When I enter the rails server command I get the following:

Toran1$ rails server
/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `require': dlopen(/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `<top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `each'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `each'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler.rb:120:in `require'
    from /Users/Toran1/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
    from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

I have installed the gem both locally and at the root level, and I also have navigated to the application folder before issuing the command. Any help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南街九尾狐 2024-11-15 01:48:50

如果您以正确的方式安装 Rails,Webrick 将自动安装。

试试这个链接
这里

如果您不想再次安装rails,请尝试使用gem命令安装服务器

不要忘记将gems包含在Gemfile中并运行“bundle install”

Webrick will install automatically if you install rails in a correct manner.

Try this link
Here

And if you don't want to install rails again, try to install server using gem command

Dont forget to include the gems in Gemfile and to run "bundle install"

智商已欠费 2024-11-15 01:48:50

如果您使用的是 Rails <需要使用3.1版本~> mysql2 gem 的 0.2.7

查看文档并搜索活动记录: https://github.com/brianmario/mysql2

我不确定这是否有助于直接解决这个问题,但它可能会解决您可能遇到的其他问题。

If you are using Rails < 3.1 you need to use version ~> 0.2.7 of the mysql2 gem

Checkout the documentation and search for active record: https://github.com/brianmario/mysql2

I'm not sure if that will help solve this problem directly, but it may solve others that you may encounter.

醉酒的小男人 2024-11-15 01:48:50

只需更新您的捆绑程序,也许任何一个较旧的 gem 与最新的 gem 冲突,就会出现此类问题。

gem install bundler

然后bundler install

如果再次发现错误,则删除 GEM.lock 文件,然后运行

bundler install

​​这可能会解决问题。

Just update your bundler, maybe of any-one of the older gem is conflicting with latest one, this type of issues arises.

gem install bundler

and then bundler install

If you find again error, then delete GEM.lock file, then run

bundler install

This may resolve the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文