如何使用unicorn和配置文件在生产模式下启动rails服务器?

时间:2013-07-01 17:06:50

标签: ruby-on-rails unicorn

我将Gem 'unicorn'添加到Gemfile并调用rails server unicorn -e production,但是我收到了加载错误。然后我添加Gem 'unicorn_rails',然后调用rails server unicorn -e production,但我找不到套接字文件。所以我在考虑它是否不使用config/unicorn.rb文件作为配置?我致电unicorn_rails -c config/unicorn.rb -E production -D,但收到了另一个错误text file busy

所以现在我被困在这件事上,你能帮助我吗? :)

3 个答案:

答案 0 :(得分:31)

应该是这样的:

bundle exec unicorn -E production -c config/unicorn.rb

你应该只需要unicorn gem

答案 1 :(得分:5)

bundle exec unicorn -p $PORT -c ./config/unicorn.rb

适合我

我把它放在Procfile中,然后使用Foreman通过输入

来启动它

foreman start

答案 2 :(得分:0)

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

service unicorn_projectName start

适合我

相关问题