Skip to content

Instantly share code, notes, and snippets.

@jkamenik
Created June 11, 2013 20:40
Show Gist options
  • Save jkamenik/5760459 to your computer and use it in GitHub Desktop.
Save jkamenik/5760459 to your computer and use it in GitHub Desktop.
Workaround for not being able to use BUNDLE_WITHOUT on Heroku cedar

Follow these steps to have bundle ignore private gems on Heroku:

  1. Enable user-env-compile: heroku labs:enable user-env-compile -a myapp
  2. Add a config to heroku to indicate it is heroku: heroku config:set HEROKU=true -a myapp
  3. Use logic in the Gemfile

Disclaimer: The downside is that Gemfile.lock will have more gem then bundler can see. It will therefore think the lock file is invalid, ignore it, and regenerate it. This is fine if you your gems mostly uptodate and include version in the Gemfile for the important gems like rails.

unless ENV['HEROKU']
group :development, :test do
gem 'private gem', :git => git@github.com:private/repo
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment