一個新的Rails項目的Gemfile中顯示:我如何使用獨角獸作爲「rails s」?
# Use unicorn as the app server
gem 'unicorn'
軌小號--help顯示:
Usage: rails server [mongrel, thin, etc] [options]
然而,這樣做的:
rails s unicorn
我得到:
/Users/patrick/.rvm/gems/[email protected]/gems/rack-1.4.5/lib/rack/handler.rb:63:in `require': cannot load such file -- rack/handler/unicorn (LoadError)
from /Users/patrick/.rvm/gems/[email protected]/gems/rack-1.4.5/lib/rack/handler.rb:63:in `try_require'
from /Users/patrick/.rvm/gems/[email protected]/gems/rack-1.4.5/lib/rack/handler.rb:16:in `get'
from /Users/patrick/.rvm/gems/[email protected]/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
from /Users/patrick/.rvm/gems/[email protected]/gems/railties-3.2.13/lib/rails/commands/server.rb:59:in `start'
from /Users/patrick/.rvm/gems/[email protected]/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/patrick/.rvm/gems/[email protected]/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/patrick/.rvm/gems/[email protected]/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>'
I'v e過去在其他項目中使用了獨角獸,但總是必須運行unicorn命令並指定一個有點痛苦的配置文件。我想知道如何通過使用「rails s」來簡化它的工作......這可能嗎?
我不認爲'unicorn'可以被稱爲從'rails server'直接。檢查了這一點 - https://github.com/samuelkadolph/unicorn-rails – Dogbert 2013-04-07 04:38:03
只需鍵入'獨角獸'爲我工作,相同數量的擊鍵作爲'軌道' – 2013-04-07 05:10:07