I have an application that must be run in three different environments, called dev, beta and prod.
I created three different applications on heroku, so all the environments can be run at the same time, and I deploy the code from the right git repo to the right application when I need to. I think that it is a completely normal situation :-)
I have a branch on git for dev purpose, when I need, I branch a beta version to deploy on beta, when it is ready, I deploy on prod and merge back to the trunk, following this branching model
I would like to add the New Relic monitoring system, as an Heroku add-on, only to one of the application, the production one. To install New Relic, you have to include a gem in the Gemfile, so I need to include the gem only for production Gemfile.
Given that the current stack on Heroku does not support the groups in the Gemfile, how can I achieve this goal? Should I have to manage by hand each gem file before bringing to production?
EDIT
To better clafify what I tried, maybe I am missing something obvious:
I added
group :production do
gem 'newrelic_rpm'
end
to Gemfile. My dev environment has RACK_ENV and RAILS_ENV set to development, when I push to heroku the application is deployed with the newrelic gem.