Managing multiple environments with Heroku
If you want to manage production and staging environments in Heroku you can follow this guide
But if you have another local server for QA that no hosted in Heroku, and you have specific group of gems for it, you can avoid installing those gems in production/staging by adding the following code, in your Gemfile:
# Heroku Patch
def hg(g)
(ENV['HOME'].gsub('/','') == 'app' ? 'test' : g)
end
group hg(:qa) do
gem 'sqlite3'
end
Note: if your ENV['HOME']
is not always defined, you probably should add some patch to avoid exceptions. For example:
ENV['HOME'] = '/home/anyuser' if ENV['HOME'].nil? #patch
Written by David Paluy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#