By samueljplatt
I followed this guide: https://gorails.com/deploy/ubuntu/14.04 to set up my application.
Now I have a few errors:
1)When I do service nginx restart, it fails. When I do sudo nginx -t it says everything is fine.
2)When I go to my website, I get Incomplete response received from application.
When I looked into the logs, it says that secret_key_base is missing. However, I have hard coded in shared/config/secrets.yml the secret key so I’m not sure what is going on.
Thanks
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!
The first step to debugging the Nginx issue is to check the error logs. You can see the most recent entries with:
- tail /var/log/nginx/error.log
By default, Rails project will hard code the secret_key_base for the test and development environments in config/secrets.yml The value for production is stored as the SECRET_KEY_BASE environmental variable:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Have you hardcoded it for production as well? The first thing I’d double check is what environment the application is starting in. If you are using Unicorn as your application server with an init script to start and stop it, a common practice is to set the RAILS_ENV in /etc/default/unicorn which the init script sources.
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.