I was trying to deploy a simple rails application( stack is Ruby 2.2.4, Rails 4.2.5, with passenger/Nginx as application/web server) to AWS EC2 and I was getting a weird error.
Incomplete response received from application
And looking at the Nginx/passenger logs I wasn't able to figure out the issue first hand. Then == I tried to debug in detail and changed the
passenger_app_env to development == so that I can see the debug logs in details and voila.!! I figured out how stupid I was.
Checking the logs, I see:
app error: Missing `secret_token` and `secret_key_base` for 'production' environment
== Yep, you got it right, I forgot to set the
secret_token in my env, and it caused the error. ==
After generating the
RAILS_ENV=production rake secret
and exporting it to the bash env using:
and restarting Nginx using
I was able to bring my rails app online.
As they say:
Making mistakes simply mean you are learning faster. ~Weston H. Agor
Hope I save someone's time in future. :)
Subscribe to Today I learned
Get the latest posts delivered right to your inbox