如何使用独角兽和配置文件在生产模式下启动 rails 服务器? [英] How to start rails server in production mode using unicorn and config file?

查看:49
本文介绍了如何使用独角兽和配置文件在生产模式下启动 rails 服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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', then call rails server unicorn -e production, but I can't find the socket file. So I am considering if it doesn't use the config/unicorn.rb file as the configuration? So I call unicorn_rails -c config/unicorn.rb -E production -D, but I get another error text file busy.

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

So now I am stuck in this matter, could you help me? :)

推荐答案

它应该是这样的:

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

你应该只需要 unicorn gem

and you should only need unicorn gem

这篇关于如何使用独角兽和配置文件在生产模式下启动 rails 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆