From: Eric Hodel Date: 2011-06-17T09:28:28+09:00 Subject: [ruby-core:37190] [Archive91 - Backport #1773][Closed] Gem path doesn't honor user gem? Issue #1773 has been updated by Eric Hodel. Tracker changed from Bug to Backport Status changed from Assigned to Closed I think this is largely a bug of ruby 1.9.1's gem_prelude. Ruby 1.9.2's gem prelude works better, please reopen if you can reproduce the issue there. ---------------------------------------- Backport #1773: Gem path doesn't honor user gem? http://redmine.ruby-lang.org/issues/1773 Author: Lin Jen-Shin Status: Closed Priority: Normal Assignee: Eric Hodel Category: Target version: ruby -v: ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] =begin Sorry that I don't have much time to investigate it or find out if this is fixed in trunk, please tell me if this is duplicated or fixed, or I need to provide more information about it. The problem is that I use only user's gem path instead of system's gem path. There's no gem in system's gem path (i.e. /usr/lib/ruby19/gems/1.9.1) I know that setting $GEM_HOME could resolve this, but this would be hard to setup correctly between versions of Ruby. using `ENV['GEM_HOME'] = "..."' and `Gem.clear_paths' could resolve too, but it's not that clear, and Gem.set_home, Gem.set_paths, Gem.use_paths doesn't work well. p.s. Anything above and below are fine with: ruby 1.8.7 (2008-12-21 MBARI 6 on patchlevel 72) [i686-linux] So I suppose this is a bug. $ gem which rack (checking gem rack-1.0.0 for rack) /home/photos/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack.rb $ ruby -ve 'gem "rack"' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] :234:in `push_gem_version_on_load_path': Could not find RubyGem rack (>= 0) (Gem::LoadError) from :14:in `gem' from -e:1:in `
' $ cat .gemrc #gemhome: /home/photos/.gem/ruby/1.8 #gempath: - /home/photos/.gem/ruby/1.8 # - /home/photos/.gem/ruby/1.9.1 gem: --no-rdoc --no-ri --user-install --format-executable $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.4 - RUBY VERSION: 1.9.1 (2009-05-12 patchlevel 129) [i686-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby19/gems/1.9.1 - RUBYGEMS PREFIX: /usr/lib/ruby19/gems/1.9.1/gems/rubygems-update-1.3.4 - RUBY EXECUTABLE: /usr/bin/ruby19 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/lib/ruby19/gems/1.9.1 - /home/photos/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - "gem" => "--no-rdoc --no-ri --user-install --format-executable" - REMOTE SOURCES: - http://gems.rubyforge.org/ $ ruby -ve 'p Gem.path' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] ["/usr/lib/ruby19/gems/1.9.1"] Gem.set_paths: $ ruby -ve 'Gem.set_paths("/home/photos/.gem/ruby/1.9.1"); p Gem.path; gem "rack"' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] ["/home/photos/.gem/ruby/1.9.1", "/usr/lib/ruby19/gems/1.9.1"] :234:in `push_gem_version_on_load_path': Could not find RubyGem rack (>= 0) (Gem::LoadError) from :14:in `gem' from -e:1:in `
' Gem.set_home: $ ruby -ve 'Gem.set_home("/home/photos/.gem/ruby/1.9.1"); p Gem.path; gem "rack"' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] ["/usr/lib/ruby19/gems/1.9.1"] :234:in `push_gem_version_on_load_path': Could not find RubyGem rack (>= 0) (Gem::LoadError) from :14:in `gem' from -e:1:in `
' Gem.use_paths and calling gem first is fine, but not for require first: $ ruby -ve 'Gem.use_paths("/home/photos/.gem/ruby/1.9.1"); p Gem.path; gem "rack"' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] ["/home/photos/.gem/ruby/1.9.1"] $ ruby -ve 'Gem.use_paths("/home/photos/.gem/ruby/1.9.1"); p Gem.path; require "rack"' ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux] ["/home/photos/.gem/ruby/1.9.1"] -e:1:in `require': no such file to load -- rack (LoadError) from -e:1:in `
' Many thanks for your listening. =end -- http://redmine.ruby-lang.org