Ruby 1.8.7 automatically loads RubyGems?

I

Intransition

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

brabuhr

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
 
K

Ken Bloom

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

Trans

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]

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'] =3D> nil
require 'facets' =3D> true
$LOAD_PATH
=3D> ["/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 =3D> [[], [], [], [], [], [], [], [], [], [], []]
Gem
=3D> Gem

It is clearly coming from Gem, but not via RUBYOPT.

Is there another way for RubyGems to get loaded automatically?
 
J

John Barnette

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]

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

Trans


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

7rans

What did you do? =A0Share! =A0=3D)

--http://spiralofhope.com

in #save_history changed:

lines =3D Readline::HISTORY.to_a.uniq

to

lines =3D 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top