Ruby: No such file to load -- ubygems (LoadError)

B

Brian Takita

Hello,

I am running the one-click ruby verion 1.8.2-15 on Windows XP.

When I try to run a ruby script, I get this error, Ruby: No such file
to load -- ubygems (LoadError).

I tried removing the RUBYOPT System variable, but I can't load any
scripts.

Ruby was working yesterday. The only thing I can think of that may
have mucked things up would be to run a $:.unshift() call in one of my
scripts yesterday.

Does anybody know what is going on and how I can solve this?

Thank you,
Brian Takita
 
M

Mark Hubbart

Hello,
=20
I am running the one-click ruby verion 1.8.2-15 on Windows XP.
=20
When I try to run a ruby script, I get this error, Ruby: No such file
to load -- ubygems (LoadError).
=20
I tried removing the RUBYOPT System variable, but I can't load any
scripts.
=20
Ruby was working yesterday. The only thing I can think of that may
have mucked things up would be to run a $:.unshift() call in one of my
scripts yesterday.
=20
Does anybody know what is going on and how I can solve this?=20

install RubyGems :) http://rubygems.rubforge.org

But seriously, it's probably due to the RUBYOPT environment variable
being set. Since unsetting it broke your scripts, there may be
something else set in it as well. If so, try removing just the
"rubygems" part of the variable's content.

But still, installing RubyGems will solve the problem, and give you
access to some very nifty software and libraries to boot.

cheers,
Mark
 
B

Brian Takita

Mark, thank you for your response.

I apologize for my hasty words. I did have RubyGems installed. When I
removed RUBYOPT, Ruby worked sans any of the Gems (which is to be
expected).

I'll try reinstalling Gems.

It's too bad RubyGems are not a part of the default Ruby installation.
 
B

Brian Takita

I tried performing the command "gem install rubygems"
It was performed successfully, however whenever I tried running a ruby
script, I still get the error "ruby: No such file to load -- ubygems
(LoadError)". I still need to try installing rubygems via the tar.gz
file.

What is interesting is irb, erb, and gem, which all use ruby.exe work
without the error. I can also load gems.
 
M

Mark Hubbart

I tried performing the command "gem install rubygems"
It was performed successfully, however whenever I tried running a ruby
script, I still get the error "ruby: No such file to load -- ubygems
(LoadError)". I still need to try installing rubygems via the tar.gz
file.
=20
What is interesting is irb, erb, and gem, which all use ruby.exe work
without the error. I can also load gems.

Unset RUBYOPT, then go into irb and inspect ruby's load path ($:).
Look in those directories for a directory "rubygems" and files
"rubygems.rb" and "ubygems.rb". If you can't find them, your RubyGems
installation is currupt; try downloading it from their website and
installing.

cheers,
Mark
 
B

Brian Takita

I removed the RUBYOPT, but irb was still able to run.

Anything in the
* RubyDir/bin
* RubyDir/lib/ruby/site_ruby/1.8 (ubygems.rb is in this directory)
directories runs ruby finds the ubygems.rb

RubyDir/bin even runs all of the installed gems.

I'd like to install the tgz version of RubyGems but I can't run
setup.rb because of the error.
:(

It seems that RubyDir/bin holds the key somewhere to get ruby working.
I'll do more investigation into this.
 
M

Mark Hubbart

I removed the RUBYOPT, but irb was still able to run.
=20
Anything in the
* RubyDir/bin
* RubyDir/lib/ruby/site_ruby/1.8 (ubygems.rb is in this directory)
directories runs ruby finds the ubygems.rb
=20
RubyDir/bin even runs all of the installed gems.
=20
I'd like to install the tgz version of RubyGems but I can't run
setup.rb because of the error.
:(

unset RUBYOPT before you run the setup script. That should allow you
to set this up properly.
It seems that RubyDir/bin holds the key somewhere to get ruby working.
I'll do more investigation into this.

Technically, it's RubyGems which isn't working. RubyGems is a separate
project, currently not affiliated with the main Ruby project.

If what I suggested above doesn't work, I'm going to have to defer
this question to someone who knows more about the windows
installation.

HTH,
Mark
 
B

Brian Takita

I tried unsettinh RUBYOPT and it did not work.
I reinstalled Ruby and everything now works.

Thank you,
Brian
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top