This error frequently occurs when your application’s secret key base is not set and you attempt to run it in production mode. If you’re are still just in the testing and development phase, the quickest way to resolve the issue is to set passenger_app_env
in your Nginx configuration to development mode:
server {
listen 80 default_server;
server_name example.com;
passenger_enabled on;
passenger_app_env development;
root /home/rails/app/public;
}
When running in production, you’ll want to make sure that the secret key base is correctly configured. First, make sure your config/secrets.yml
file contains:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Next, generate a secret key base by running the command rake secret
in your Rails project. Now export that value as the SECRET_KEY_BASE
environmental variable.
For more info, check out:

by O.S Tezer
In this DigitalOcean article, we are going to show you -- from start to finish -- how to have a rock solid Rails application deployment (i.e. published online) using the latest available CentOS operating system renowned for its stability. This will be alongside Phusion Passenger application server, known for its simplicity and excellent features, coupled with Nginx HTTP server running in front to handle and manage connections.