Ruby rails WEBrick服务器退出时有错误我不明白

时间:2011-12-21 13:59:20

标签: ruby webrick

我已经创建了一个应用程序但是当我启动rails服务器时,我得到以下输出。有人指出我正确的方向,我做错了吗?我把头发拉出来了!

=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/session/cookie.rb:1
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/middleware/session/cookie_store.rb:4
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:in `const_get'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:in `session_store'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:172:in `default_middleware_stack'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:146:in `tap'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:146:in `default_middleware_stack'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/engine.rb:446:in `build_middleware_stack'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/finisher.rb:37
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `run_initializers'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `send'
    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/khussain/delete/config/environment.rb:5
    from /home/khussain/delete/config.ru:4:in `require'
    from /home/khussain/delete/config.ru:4
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
    from /home/khussain/delete/config.ru:1:in `new'
    from /home/khussain/delete/config.ru:1

2 个答案:

答案 0 :(得分:1)

如果上述方法不起作用,那可能是因为你没有.Gem文件?

答案 1 :(得分:0)

这看起来像缺少宝石(openssl),没有看到我不确定的代码。

最好的办法就是:

bundle install

如果仍然无效,请尝试将openssl添加到Gemfile并再次运行bundle install