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.

About these ads

, ,

  1. #1 by Max Williams on May 31, 2011 - 12:37 pm

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

  2. #2 by danteata on April 21, 2012 - 8:58 am

    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

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 27 other followers

%d bloggers like this: