Question

I need to package a copy of Redmine with all gems in a named local path. Redmine requires a few gems:

gem "rails", :path => File.join('..', 'lib', 'gems', 'rails-3.2.14')
gem "jquery-rails", :path => File.join('..', 'lib', 'gems', 'jquery-rails-2.0.3')
gem "i18n", :path => File.join('..', 'lib', 'gems', 'i18n-0.6.5')
gem "coderay", :path => File.join('..', 'lib', 'gems', 'coderay-1.0.9')
gem "fastercsv", :path => File.join('..', 'lib', 'gems', 'fastercsv-1.5.5')
gem "builder", :path => File.join('..', 'lib', 'gems', 'builder-3.0.4')
gem "pg", :path => File.join('..', 'lib', 'gems', 'pg-0.17.0')
gem "thin", :path => File.join('..', 'lib', 'gems', 'thin-1.5.1')

These gems require their own gems, they then require their own ones etc. How do I also specify the local copies of these so they're not just downloaded from rubygems.org?

In essense, when I run "bundle install", how do I make it grab all dependencies (including nested dependencies) from "../lib/gems/*"?

Was it helpful?

Solution

If you 'bundle pack' after 'bundle install', all of gems that specified in Gemfile is cache to 'vendor/cache' directory in your rails project. Next, you can install all of your gems with 'bundle install --local'.

It will be extremely faster than just 'bundle install'.

Cheers, Sangil.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top