Bundler caching issues when updating gem locally

If I have a gem locally that I change without updating the version number the bundler never seems to notice.

I have a gem fx 'devise-assistant' version 0.1.0. If I add a single method and run 'rake install' and then 'bundle install' in my Rails app, then bundler seems to think the gem has not been 'touched' (since no version change?) and hence my Rails app uses the old "cached" gem (NoMethodError).

Would be nice with a new bundler task, which forces a certain gem (gems or all gems!) to be resolved anew.

$ bundler update GEM

$ bundler update devise-assistant

$ bundler update gem1 gem2 gem3

$ bundler update-all

or maybe

$ bundler install --force-update devise-assistant

Right now I have two options. Either do the version bump on the gem, then 'bundle install' or ... remove from Gemfile, run 'bundle install' reinsert in gemfile, run 'bundle install'. Yikes!

Maybe I should make a batch script or thor task to facilitate this hack :stuck_out_tongue: haha!

Don't do this. Seriously. Long-term, it's a one-way ticket to dependency hell.

--Matt Jones

First of all, this is not a list to discuss Bundler features or development. Ask on #carlhuda Freenode channel.

But now that you’re here, I can give you advice: bundling versioned gems is only meant for libraries that are not in active development at this moment. For libraries that you current work on locally, there is the “path” option which tells Bundler “add the gem/library under this path to load paths”. Perfect for development, and when you release a (relatively) stable version which you want to share, switch back to gem method with version specification. Bump up the version after each cycle.

Correct. Just append a timestamp as the last version element in your local environment (and on every non-release or automated build)

Thank you so much! Just what I was looking for. I knew there had to be a way... It doesn't seem like the :path option is mentioned much however.