Home Production does'nt work ( Rails 5 , Passenger , Nginx )
Reply: 0

Production does'nt work ( Rails 5 , Passenger , Nginx )

user1934 Published in May 21, 2018, 10:30 pm

I deployed my app to server. ( Rails 5 , Passenger , Nginx ) My app was working on development mode. But i changed my mode to production and it i got this error ( /var/log/nginx/error.log ) :

[ 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>'

After this error i switched my mode to development. And i got same error again !

my nginx file :

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;


Need help to solve this problem !

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301189 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO