If you want to install only gems for production you can use this command:
bundle install --without development test
or for Heroku:
$ heroku config:add BUNDLE_WITHOUT="test development" --app app_name
This excludes the development and test environment. If you defined more groups you can add them at the end of this command.