In Rails 2.x, what is the difference between "rake gems:unpack" and "rake gems:freeze"?
It seems that both methods can freeze a gem into the vendor
directory, but rake gems:unpack
requires the gem to be listed
in config/environment.rb
as config.gem '<name of the gem>'
before the rake
is done.
On the other hand, rake gems:freeze
requires installing the gem gemsonrails
first, and uses the syntax rake gems:freeze GEM=haml
and it
doesn't require listing the gem in environment.rb
first. But it doesn't work with the current GEM class (probably requires gem 1.3.6 instead of 1.3.7).
Besides these, what are the differences between them? Do they work very similarly and achieve the same purpose? gemsonrails
's webpage开发者_C百科 wasn't updated since 2007; is rake gems:unpack
the
more preferred way of freezing a gem if not using Bundler?
I've been wrangling with config.gem and unpacked gems for a long time, but never actually used rake gems:freeze.
The reason being that I never tried to get all gems unpacked/frozen (which I believe is the same thing), only those that caused problems during the rake gems:install process by introducing circular dependencies together with the environment.
So I can't completely answer your question - but I would advise to switch to bundler. I've used it with Rails 2.3.1, and never looked back to the gems:install system (bundler has or had some problems as well, but never on same nightmarish level).
精彩评论