Hi, I have a problem with Rails configuration and setup on server.
I have Rails application, and I hosted it using Unicorn and Nginx, but now I can’t access to application. I did pull origin master and I pulled the latest changes but I also did sudo service nginx stop. Now when I did ngnix start I am getting an error: nginx: [emerg] unknown directive “rails_env” in /etc/nginx/sites-enabled/default:10
My default file is:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name example.com;
rails_env production;
root /home/rails/public;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Unicorn is running.
Any help please,
Bojan
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
But I am using unicorn ??
I don’t have Passenger instaled.
How I can to fix it without install passenger?
nginx: [emerg] unknown directive "rails_env" in /etc/nginx/sites-enabled/default:10
rails_env is not a valid Nginx directive by default. It is part of Phusion Passenger. It’s an alias for passenger_app_env Do you have Passenger installed?
Enable it for your server block by adding:
passenger_enabled on;
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.