9

我正在使用 ruby​​ 1.9.3 和 rails 3.2.2。每次我使用带有 private_pub gem 的瘦服务器时,它都不起作用,我做了 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>'
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>'

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

4

3 回答 3

21

没有 linux 就无法启动 linux。

没有 Rack 就无法启动机架服务器。

没有薄宝石,您就无法启动薄。

于 2012-03-05T20:00:26.620 回答
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'

然后捆绑安装

于 2012-05-15T04:52:39.377 回答
1

如果你想使用一个 gem,它必须在你的Gemfile. 您可以按以下方式解决您的问题:

  • 将以下行添加到您的Gemfilegem 'thin'
  • 更新您当前应用的环境:bundle install
  • 启动网络服务器:bundle exec thin start
于 2012-03-05T20:48:26.323 回答