views:

20

answers:

1

Our project is Rails 2.2.2, maybe it can't use Bundler? (or maybe for some other reasons, Bundler cannot be used)

Then in that case, what is the most preferred way of freezing the gems into the project source tree?

Some that I know of are:

rake gems:freeze
  needs gemsonrails and it doesn't work with the current gem 1.3.7

rake gems:unpack   
  will not freeze the depended gems.  have you add it one by one manually

script/plugin install
  need to install the depended gems one by one as well
A: 

you can unpack the gems into your vendor directory. once they are on the server just run rake gems:unpack and that will build them like how plugins are built or at least put into the file structure.

I've done this not for dependency and upgrade issues but for shared hosts, hosts without gem support, and actually to modify gems that need a one liner tweek.

Sam
so you mean using the `rake gems:unpack` method... it is ok except needing to add the depended gem one by one to `environment.rb` as `config.gem '<gem_name>'` and do a `rake gems:unpack` again
動靜能量
all I really know is that unpack takes the gems and puts them in the vendor/gems/ folder so they are 'frozen' if you will. I think you still have to declare them in the environment.rb file. I just left them declared in the environment.rb file and all seemed to work fine. This is all anecdotal though.
Sam
did you rake gems:install?
Sam
that will install missing gems, hopefully dependents. Which gems are you working with btw. you might need to include a library :lib => such as with syntax highlighting
Sam