Unicorn不在生产模式下运行

时间:2013-03-16 17:19:59

标签: ruby-on-rails ruby-on-rails-3 nginx unicorn

我正在运行堆栈nginx + unicorn + rails 3.2

当我跑步时

bundle exec unicorn_rails -c config/unicorn.rb -E development

没关系,网站运行良好

当我尝试在生产模式下启动独角兽网站时

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

我有“我们很抱歉,但出了点问题。”错误:

enter image description here

3 个答案:

答案 0 :(得分:2)

您是否为生产运行迁移?

rake db:migrate RAILS_ENV="production"

问题可能不是Unicorn。

答案 1 :(得分:2)

只需在config / production.rb

中添加config.log_level = :debug即可

您将在log / production.log中收到错误日志 粘贴该日志的输出,以便我可以帮助您

也尝试rake assets:precompile

答案 2 :(得分:1)

问题出现在脚本预编译中。通过在以下行中添加“config / environments / production.rb”来解决它:

config.assets.compile = true
相关问题