2012-03-05 68 views
9

我使用的是Ruby 1.9.3和rails 3.2.2。每次我使用帶有private_pub gem的瘦服務器時,它都不起作用,我做了一些機密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>' 
[email protected]:~/paper$ rvm 1.9.3 
[email protected]:~/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>' 

但我包括我的寶石薄寶石文件,它會正常工作。任何幫助謝謝。

回答

21

你不能在沒有linux的情況下啓動linux。

如果沒有Rack,則無法啓動機架服務器。

如果沒有薄寶石,你不能發射瘦。

+1

我由Ryan貝茨查了教程,並在他的源代碼,他並沒有包括薄寶石 – Uchenna 2012-03-05 20:05:35

+0

但是他單薄這種寶石庫 – shingara 2012-03-05 20:06:28

+0

我也有它安裝 – Uchenna 2012-03-05 20:19:35

1

如果你想使用寶石,它必須在你的Gemfile

  • 以下行添加到您的Gemfilegem 'thin'
  • 更新您的當前應用程序的環境:bundle install
  • 啓動Web服務器:bundle exec thin start
+0

你的意思是寶石? :) – AMIT 2012-03-06 15:36:12

+0

當然可以。謝謝! – 2012-03-06 17:49:15

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>' 
可以按如下方式解決你的問題

我有同樣的問題。與修復:

添加此寶石的Gemfile

gem 'faye' 
gem 'thin' 

然後捆綁安裝

+2

許多人認爲這可能是使用Rails 4/Ruby 2,以及在faye上使用Ryan Bate的railscast#260。 '$ rackup faye.ru -s thin -E production' 他在寶石文件中沒有'faye'或'thin'。儘管在'faye'和'thin'上都執行了'gem install',@對於Rails 4,'faye'&'thin',至少需要在gem文件中,並且在服務器啓動之前執行'bundle install'。 – 2013-11-07 13:32:15

+0

謝謝..修復程序適用於我.. – 2015-10-06 12:57:12