Seeing a Ruby On Rails app on a Browser

I am running a VPS on Centos6.6. I removed Apache and installed Nginx, plus Ruby and Rails and Passenger. Created a sample Hello_World and followed directions from a couple of sites. But when I go to my Browser and point to the site I get an “Incomplete response received from the application” message


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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;
    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:

  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: