# Ruby 1.8.7 automatically loads RubyGems?

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424>\
**Category:** Ruby\
**Created:** [August 26, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424 "2009-08-26T17:49:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 26, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/1 "2009-08-26T17:49:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 26, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/2 "2009-08-26T17:55:02Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 26, 2009, 6:13pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/3 "2009-08-26T18:13:47Z")

</div>

On Tue, Aug 25, 2009 at 2:33 PM, Intransition[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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]

> ruby -v -rubygems -e ‘require “rush”’  
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

> ruby -v -e ‘require “rush”’  
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]  
> -e:1:in `require’: no such file to load – rush (LoadError)  
> from -e:1

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 26, 2009, 11:48pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/4 "2009-08-26T23:48:12Z")

</div>

On Aug 26, 9:08 am, Ken B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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?

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 27, 2009, 5:39am UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/5 "2009-08-27T05:39:57Z")

</div>

On Aug 26, 6:32 pm, John B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> irbrc?

Damn you Wirble !!!

Yes, .irbrc was the source. Thank you. (In hindsight I should have  
tried ‘ruby -rfacets’. That would have made it obvious. Oh well.)

On the upside, I upgraded Wirble, and while I was at it, hacked it a  
bit to make it better.

Thanks for the help, guys.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 27, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/6 "2009-08-27T16:43:11Z")

</div>

On Thu, 27 Aug 2009 12:39:34 +0900  
Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On the upside, I upgraded Wirble, and while I was at it, hacked it a  
> bit to make it better.

What did you do? Share! =)

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 27, 2009, 12:33am UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/7 "2009-08-27T00:33:17Z")

</div>

On Aug 26, 2009, at 2:47 PM, Trans wrote:

> > the wrong place for environment variables anyway).  
> > =\> nil  
> > ?\> 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.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [August 27, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-automatically-loads-rubygems/174424/8 "2009-08-27T19:35:19Z")

</div>

On Aug 27, 10:42 am, spiralofhope [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Thu, 27 Aug 2009 12:39:34 +0900
> 
> Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > On the upside, I upgraded Wirble, and while I was at it, hacked it a  
> > bit to make it better.
> 
> What did you do? Share! =)
> 
> –[http://spiralofhope.com](http://spiralofhope.com)

in #save\_history changed:

lines = Readline::HISTORY.to\_a.uniq

to

lines = Readline::HISTORY.to\_a.reverse.uniq.reverse

so that the most recent lines remain.

And for now I also got rid of the use of yellow, since I can’t see it  
on a white background.

Is there a conical repository? I would like to fork it and do a little  
more work besides, maybe add some extra options.

T.
