0
我將我的應用程序部署到服務器。 (Rails 5,Passenger,Nginx) 我的應用程序正在開發模式。 但我改變了我的方式來生產,這我得到這個錯誤(/var/log/nginx/error.log):在這個錯誤我換我的模式發展生產不起作用(Rails 5,Passenger,Nginx)
[ E 2017-11-10 20:11:03.9343 21613/Tb age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/rails/myapp: An error occurred while starting up predloader
Error ID: ca909334
Error details saved to: /tmp/passenger-error-iGQLnf.html
Message from application: cannot load such file -- /home/rails/myapp/config/environment (LoadError)
config.ru:3:in `require_relative'
config.ru:3:in `block in <main>'
/usr/local/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/lib/ruby/gems/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
。我又有同樣的錯誤!
我nginx的文件:
server {
listen 80;
server_name myapp.com www.myapp.com;
access_log off;
return 301 https://www.myapp.com$request_uri;
}
server {
listen 443 ssl;
ssl on;
ssl_certificate /etc/nginx/ssl/myapp.com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/myapp.key;
server_name myapp.com www.myapp.com;
passenger_enabled on;
rails_env production;
root /home/rails/myapp/public;
index index.html index.htm;
}
需要幫助解決這個問題!
你可以添加乘客配置和錯誤內容保存在/tmp/passenger-error-iGQLnf.html –
我添加/tmp/passenger-error-iGQLnf.html –
在所有文件中,你的應用程序名稱是'myapp'在乘客eoor-iGQLnf.html中,您的應用名稱顯示爲'trbodybuilding'。你能解釋一下嗎? 還添加乘客配置文件的內容。 –