views:

361

answers:

3

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?

+8  A: 

The Bundler equivalent is bundle package. It packages all of the .gem files specified in the Gemfile into vendor/cache so that future installs get the gems from this cache rather than from http://rubygems.org/

John Topley
Thanks for reassuring me that this *is* expected behavior. It doesn't really solve my root problem though, so I have accepted Ole's answer instead.
troelskn
A: 

Yep. Follow John Topley's answer.

rodrigo3n
Not going to mod down as I assume you can't comment on other posts yet but this would normally be a comment in support of a post rather than a whole new answer.
Shadwell
+5  A: 

Answering the second part of your question, developing a plugin/gem and shipping it with the rails app without making the gem publicly available, you may do this

Gemfile

gem 'my_private_gem', :path => "#{File.expand_path(__FILE__)}/../vendor/gems/my_private_gem-VERSION"

assuming you performed a gem unpack my_private_gem-VERSION --target vendor/gems

Ole Morten Amundsen
Not exactly what I expected, but it will do.
troelskn