Reputation: 5810
Is there a way to detect if a rails app is running on Heroku?
I want to make a method like:
def on_heroku?
...
end
Upvotes: 5
Views: 1758
Reputation: 16012
You may set your own config vars to use for detection via ENV['var']
.
$ heroku config:add I_AM_HEROKU=yes
def on_heroku?
ENV['I_AM_HEROKU']
end
Upvotes: 7