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

Discussion in 'Ruby' started by Brian Takita, May 12, 2005.

  1. Brian Takita

    Brian Takita Guest

    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
    Brian Takita, May 12, 2005
    #1
    1. Advertising

  2. Brian Takita

    Mark Hubbart Guest

    On 5/11/05, Brian Takita <> wrote:
    > 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
    Mark Hubbart, May 12, 2005
    #2
    1. Advertising

  3. Brian Takita

    Brian Takita Guest

    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.
    Brian Takita, May 12, 2005
    #3
  4. Brian Takita

    Brian Takita Guest

    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.
    Brian Takita, May 12, 2005
    #4
  5. Brian Takita

    Mark Hubbart Guest

    On 5/12/05, Brian Takita <> 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.
    >=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
    Mark Hubbart, May 12, 2005
    #5
  6. Brian Takita

    Brian Takita Guest

    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.
    Brian Takita, May 12, 2005
    #6
  7. Brian Takita

    Mark Hubbart Guest

    On 5/12/05, Brian Takita <> wrote:
    > 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
    Mark Hubbart, May 13, 2005
    #7
  8. Brian Takita

    Brian Takita Guest

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

    Thank you,
    Brian
    Brian Takita, May 24, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruby Ruby
    Replies:
    0
    Views:
    182
    Ruby Ruby
    Apr 22, 2004
  2. Zoong Pham
    Replies:
    1
    Views:
    266
    Chad Fowler
    Aug 11, 2005
  3. Replies:
    1
    Views:
    307
    Eric Hodel
    Oct 25, 2005
  4. Replies:
    0
    Views:
    90
  5. Paul van Delst
    Replies:
    6
    Views:
    130
    Eric Hodel
    Dec 29, 2006
Loading...

Share This Page