Heroku staging for your rails app

Heroku is the best platform to host our rails applications for free. Many people are using heroku to live their applications. Whenever you hosted your rails app on heroku, by default it runs in production mode. Now if you want to run your app on staging you specify some configuration. Here they are:

1) First create a file staging.rb in ‘config/environments/‘ directory and copy the contents which are there in production.rb file.

     Note: Please see contents and then copy.

2) Do necessary configurations what you need for your app to run application in staging mode. In my case I did configuration for facebook.

3) Next run this ‘heroku config:add RACK_ENV=staging‘ . It will restart your app in staging mode. Now access URL. That’s it.

Any suggestions or feedback would be welcome.

Advertisements

2 thoughts on “Heroku staging for your rails app

  1. Thanks – couldn’t find out from the heroku guides how to make the app run in staging mode, ie step 3 of your post 🙂

    Like

  2. For some reason, I had to add 1 extra step to get my app pick the staging.rb in ‘config/environments/‘ directory: ‘heroku config:add RAILS_ENV=staging‘.
    Thanks

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s