I tried Pasha's suggestion, but it looks like the environment variable
is ignored by bundler in heroku.

I added autotest-fsevent to the :development group in my gemfile, and
added BUNDLE_WITHOUT=test:development to the heroku app config. But
when I pushed, heroku still tried to build the native extensions and
failed.

I don't understand why heroku doesn't just use "bundle install --
deployment" (or some variation) to respect the Gemfile groups...


I got another idea. Hide autotest-fsevent from Heroku by
using :platforms. According to the bundler docs the platform is
respected automatically.

Unfortunately they don't have an "OSX" platform, so I randomly chose
one that doesn't match Heroku just to test.

platforms :mswin do
  gem "autotest-fsevent"
end

It worked! The gem was not installed and the push succeeded. The next
step would be to hack my local bundler to make it think I'm on :mswin
(or :jruby), so that the gem gets picked up locally.

Important note: only the block version of :platform works due to a
bug:

http://github.com/carlhuda/bundler/issues#issue/590

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to