I'm picking up a Rails app that is using a lot of older gems.  We're
using Rails 2.0.2 and planning to move to to Rails 2.3 along with
upgrading the the dependencies.  However, in the meantime, we're moving
servers around and adding new folks to the dev team, so I thought it
wise to "freeze" the gems.  I'm trying to follow the methodology
described here:
http://errtheblog.com/posts/50-vendor-everything
and here:
http://wiki.joyent.com/shared:kb:installing-rails

Unfortunately, the gems don't seem to be found.

Here's what I did... I had all the old gems installed to ~/.gems and all
the tests passed.  Then I unpacked the gems into /vendor/gems

cd ~/rails/vendor/gems
gem unpack exifr
gem unpack rmagick
gem unpack tzinfo
gem unpack uuidtools

I added the following to config/enviroment.rb inside
Rails::Initializer.run do |config|

config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
  File.directory?(lib = "#{dir}/lib") ? lib : dir
end
# print out my load_paths for debugging
config.load_paths.each do |p|
  puts p
end

and later:
require 'rubygems'
gem 'exifr', '=0.10.6'
gem 'uidtools', '=1.0.2'
gem 'rmagick', '=1.15.8'
gem 'tzinfo', '=0.3.5'

Here's what happens:
$rake test:units
(in /home/sallen/rails)
/home/sallen/rails/test/mocks/development
/home/sallen/rails/app/controllers/
/home/sallen/rails/app
/home/sallen/rails/app/models
/home/sallen/rails/app/controllers
/home/sallen/rails/app/helpers
/home/sallen/rails/config
/home/sallen/rails/lib
/home/sallen/rails/vendor
/home/sallen/rails/config/../vendor/rails/railties/lib/../builtin/rails_info/
/home/sallen/rails/vendor/gems/exifr-0.10.6/lib
/home/sallen/rails/vendor/gems/tzinfo-0.3.5/lib
/home/sallen/rails/vendor/gems/rmagick-1.15.8/lib
/home/sallen/rails/vendor/gems/uuidtools-1.0.2/lib
rake aborted!
Could not find RubyGem exifr (= 0.10.6)

(See full trace by running task with --trace)
$ ls vendor/gems/
exifr-0.10.6  rmagick-1.15.8  tzinfo-0.3.5  uuidtools-1.0.2

I must be missing something basic.  Any ideas?

Thanks in advance,
Sarah
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to