在没有精简gem的情况下启动瘦服务器不起作用

时间:2012-03-05 19:40:19

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 thin faye

我正在使用ruby 1.9.3和rails 3.2.2。每次我使用瘦服务器与private_pub gem它不起作用我做了rackup private_pub.ru -s瘦-E生产。我收到以下错误

/home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `block in get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `load'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `<main>'
rzaartz@ubuntu:~/paper$ rvm 1.9.3
rzaartz@ubuntu:~/paper$ rackup private_pub.ru -s thin -E production
/home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `block in get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `load'
    from /home/rzaartz/.rvm/gems/ruby-1.9.3-p125/bin/rackup:19:in `<main>'

但我在我的宝石文件中包含了瘦宝石,它可以正常工作。任何帮助谢谢。

3 个答案:

答案 0 :(得分:21)

没有linux你就无法启动linux。

如果没有Rack,则无法启动rackup服务器。

如果没有薄宝石,你就无法推出。

答案 1 :(得分:14)

/home/dimas/RUBY/application/faye-tutorial/faye.ru:3:in `require': cannot load such file -- thin (LoadError)
    from /home/dimas/RUBY/application/faye-tutorial/faye.ru:3:in `block in <main>'

我有同样的问题。修复它:

将此gem添加到Gemfile

gem 'faye'
gem 'thin'

然后捆绑安装

答案 2 :(得分:1)

如果您想使用某个宝石,它必须位于您的Gemfile中。您可以按如下方式解决问题:

  • 将以下行添加到Gemfilegem 'thin'
  • 更新您当前的应用环境:bundle install
  • 启动网络服务器:bundle exec thin start