From: John Barnette Date: 2009-08-27T07:32:26+09:00 Subject: Re: Ruby 1.8.7 automatically loads RubyGems? On Aug 26, 2009, at 2:47 PM, Trans wrote: > On Aug 26, 9:08 am, Ken Bloom wrote: >> On Wed, 26 Aug 2009 03:33:35 +0900, Intransition wrote: >>> Does Ruby 1.8.7 automatically load gems? I took -rubygems out of my >>> RUBYOPT, and discovered my gems were still getting loaded. Is that >>> true? >> >>> $ ruby -v >>> ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] >> >>> T. >> >> Did you remember to do that in an active shell (with the command >> "unset >> RUBYOPT") or did you do it in your .profile (or .bash_profile >> or .bashrc) >> and expect it to take effect immediately? If you edit >> your .profile, it >> doesn't take effect immediately -- you need to log out and log back >> in. >> If you edit your .bashrc, you need to open a new shell (and .bashrc >> is >> the wrong place for environment variables anyway). > > $ sudo gem install facets > Successfully installed facets-2.7.0 > 1 gem installed > Installing ri documentation for facets-2.7.0... > Updating ri class cache with 4818 classes... > Installing RDoc documentation for facets-2.7.0... > $ unset RUBYOPT > $ irb >>> ENV['RUBYOPT'] > => nil >>> require 'facets' > => true >>> $LOAD_PATH > => ["/usr/lib/ruby/gems/1.8/gems/wirble-0.1.2/bin", "/usr/lib/ruby/ > gems/1.8/gems/wirble-0.1.2/.", "/usr/local/lib/site_ruby/1.8", "/usr/ > local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/ > usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64- > linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ > ruby/1.8/x86_64-linux", "."] >>> $LOAD_PATH.map do |lp| > ?> Dir[File.join(lp, 'facets')] >>> end > => [[], [], [], [], [], [], [], [], [], [], []] >>> Gem > => Gem > > It is clearly coming from Gem, but not via RUBYOPT. > > Is there another way for RubyGems to get loaded automatically? irbrc? ~ j.