How do I vendorize gems for Rails3/Bundler

Viewed 30762

In Rails 2.X, I could simply copy gems into vendor/gems/gem_name, or use the rake command rake gems:unpack. Since Rails3 uses bundler, it doesn't appear to work anymore. I have found the command bundle package, but it doesn't work the same way.

Edit:

So, just to elaborate a bit on this:

The way that rails 2 worked, I could easily grep to find stuff in vendor/gems. If they are bundled up in .gem files, that isn't possible. Also, when developing a gem/plugin, it's very helpful to have it placed within a rails application to test it out in context. How would I do such things with bundler/rails3? Is my workflow inherently broken somehow?

5 Answers

The correct Bundler equivalent is bundle install --deployment. This will install the gems, in their unpacked state, in vendor/bundle.

Consider using "hosted" development infrastructure delivered by the hosted_gem_development gem.

Developing gems is often tricky because they act like separate projects with regard to the applications you use them in.

"Hosted" development infrastructure makes gem development easier by including them into (making them "hosted by") your live application. Then you update your gem's code like you update regular application code.

Go to project page

Related