Forum: Ruby Can't require rubygems on osx

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris H. (Guest)
on 2009-03-05 22:51
Hey there!

Pretty weird, actually, but I can't require rubygems on osx. I *know*
it's installed, been using it for ages to install gems. But no way I can
"require 'rubygems'", not in irb, not in a sourcefile:

[~]% ruby -e "require 'rubygems'"
-e:1:in `require': no such file to load -- rubygems (LoadError)
  from -e:1
[~]%

Is this usual? If I recall correctly, gems was installed from source,
maybe I missed some rough corner, or something.
Sandor Szücs (Guest)
on 2009-03-06 01:50
(Received via mailing list)
On 05.03.2009, at 21:50, Chris H. wrote:
> Pretty weird, actually, but I can't require rubygems on osx. I *know*
> it's installed, been using it for ages to install gems. But no way I
> can
> "require 'rubygems'", not in irb, not in a sourcefile:
>
> [~]% ruby -e "require 'rubygems'"
> -e:1:in `require': no such file to load -- rubygems (LoadError)
>  from -e:1
> [~]%

On Mac OSX 10.5 is ruby,irb,gem preinstalled in /usr/bin/ . I am not
sure
on OSX < 10.5.
Maybe you can try if that works: /usr/bin/ruby -e 'require "rubygems"'

Maybe you have installed more than one ruby and irb on your computer.
If you run a zsh then you can ask with `where ruby`, where in the system
ruby is found.

If you installed ruby and irb from macports, then it will not find
rubygems, because you need the package rb-rubygems installed, too.

hth. regards, Sandor
Szücs
Chris H. (Guest)
on 2009-03-06 12:38
Sandor Szücs wrote:
>
> On Mac OSX 10.5 is ruby,irb,gem preinstalled in /usr/bin/ . I am not
> sure
> on OSX < 10.5.
> Maybe you can try if that works: /usr/bin/ruby -e 'require "rubygems"'
>
> Maybe you have installed more than one ruby and irb on your computer.
> If you run a zsh then you can ask with `where ruby`, where in the system
> ruby is found.
>
> If you installed ruby and irb from macports, then it will not find
> rubygems, because you need the package rb-rubygems installed, too.
>
> hth. regards, Sandor
> Sz�cs

You got me on the right track. When installing rubygems from source, I
ran "rake install", instead of "/my/ruby setup.rb".

Most of the times, the most weird problems, arise when one makes a
simple but crucial mistake.
This topic is locked and can not be replied to.