2015-12-07 125 views
0

我剛剛成功地將我的RoR應用程序部署到使用橡膠& Capistrano的AWS。但是,當我導航到頁面時,它顯示默認的nginx頁面。顯然,我在設置階段錯過了一些東西,將nginx/unicorn指向正確的目錄來爲我的應用程序提供服務。Capistrano部署獨角獸錯誤未初始化常量RAILS_ENV(NameError)

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默認頁面問題。有人可以分享我做錯了什麼,或錯過了嗎?

回答

0

你需要清除默認的nginx虛擬主機通常在/etc/nginx/sites-enabled/default,只需刪除該文件,然後你應該很好去。

+0

該目錄不存在。我認爲這是因爲我部署橡膠/ Capistrano。因此,我看到一個'conf.d /'和'rubber /'文件夾,其中包含相應的'.conf'文件。 – Godzilla74

+0

你在部署什麼操作系統? – CWitty

+0

我正在使用Ubuntu – Godzilla74

相關問題