How to start rails server in production mode using unicorn and config file?

后端 未结 3 477
鱼传尺愫
鱼传尺愫 2021-01-01 16:58

I add Gem \'unicorn\' to Gemfile and call rails server unicorn -e production, but I get a load error. Then I add Gem \'unicorn_rails\'

相关标签:
3条回答
  • 2021-01-01 17:37

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

    works for me

    I put it in the Procfile and then use Foreman to start it off by entering

    foreman start

    0 讨论(0)
  • 2021-01-01 17:38
    web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
    
    service unicorn_projectName start
    

    works for me

    0 讨论(0)
  • 2021-01-01 17:40

    It should be something looks like:

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

    and you should only need unicorn gem

    0 讨论(0)
提交回复
热议问题