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

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

install RubyGems :slight_smile: 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

···

On 5/11/05, Brian Takita <brian.takita@gmail.com> wrote:

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?

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.

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.

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

···

On 5/12/05, Brian Takita <brian.takita@gmail.com> wrote:

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.

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

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

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

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

···

On 5/12/05, Brian Takita <brian.takita@gmail.com> wrote:

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

Thank you,
Brian