Capistrano部署unicorn ERROR未初始化的常量RAILS_ENV(NameError)

时间:2015-12-07 19:31:27

标签: ruby-on-rails nginx capistrano unicorn

我刚使用Rubber& amp;成功将我的RoR应用程序部署到AWS Capistrano的。但是,当我导航到页面时,它会显示默认的nginx页面。很明显,我在设置阶段错过了一些东西,将nginx / unicorn指向正确的目录来为我的应用程序提供服务。

default nginx

当我运行tail -f log/unicorn.stderr.log时,我看到以下内容:

E, [2015-12-07T14:23:41.253757 #3808] ERROR -- : reaped #<Process::Status: pid 24405 exit 1> worker=0
E, [2015-12-07T14:23:41.301617 #24409] ERROR -- : uninitialized constant RAILS_ENV (NameError)
/ebs/microposts2-production/current/config/unicorn.rb:73:in `rescue in block in reload'
/ebs/microposts2-production/current/config/unicorn.rb:61:in `block in reload'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:611:in `call'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:611:in `init_worker_process'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:639:in `worker_loop'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:283:in `join'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/gems/unicorn-5.0.1/bin/unicorn_rails:209:in `<top (required)>'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `load'
/ebs/microposts2-production/shared/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `<main>'

我认为,因为环境附加到我的应用名称Rubber.env已存在,但是这个错误让我想到了。哎呀,我甚至不确定这个问题是否适用于nginx默认页面问题。有人可以分享我做错了什么,或错过了什么?

2 个答案:

答案 0 :(得分:1)

对于任何人来说,修复独角兽模板5.0+都可行,请参考:

  

https://github.com/rubber/rubber/issues/570

答案 1 :(得分:0)

您需要通常在/etc/nginx/sites-enabled/default清除默认的nginx虚拟主机,只需删除该文件然后就可以了。