0

在我的应用程序中,在过去的几天里,我无法再运行rails server/rails s甚至bundle exec rails server命令。它以前像魅力一样运行。

我尝试使用 git 还原更改,但没有运气,我尝试了我能想到的所有可能的礼仪。我使用 ruby​​mine,但使用 Terminal 时同样的问题。

当我运行时:

ma@SL510:~/ts$ rails server

我得到以下错误堆栈跟踪:

from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392@global/gems/unicorn-4.6.2/lib/unicorn/http_request.rb:4:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392@global/gems/unicorn-4.6.2/lib/unicorn.rb:103:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
    from /home/ma/ts/config/application.rb:16:in `<top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    from /home/ma/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我不知道我该如何解决这个问题,让 rails server 命令再次运行!任何帮助将不胜感激!

ps:如果我需要提供更多信息,请告诉我。谢谢。

4

2 回答 2

1

感谢 Jef 创建了一个新的 gemset 并使用它,然后:

gem install unicorn 

修复了该命令的问题:)

于 2013-04-04T14:48:50.633 回答
0

您可以尝试创建一个全新的 gemset(并使用它),然后bundle install让 Bundler 安装 Gemfile 中列出的 gem。堆栈跟踪似乎表明您正在使用全局 gemset,这是一个非常糟糕的主意。

于 2013-04-05T12:23:02.580 回答