# Can't require rubygems on osx

**URL:** <https://www.ruby-forum.com/t/cant-require-rubygems-on-osx/162115>\
**Category:** Ruby\
**Created:** [March 5, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/cant-require-rubygems-on-osx/162115 "2009-03-05T21:51:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [March 5, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/cant-require-rubygems-on-osx/162115/1 "2009-03-05T21:51:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [March 6, 2009, 12:50am UTC](https://www.ruby-forum.com/t/cant-require-rubygems-on-osx/162115/2 "2009-03-06T00:50:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [March 6, 2009, 11:38am UTC](https://www.ruby-forum.com/t/cant-require-rubygems-on-osx/162115/3 "2009-03-06T11:38:38Z")

</div>

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.
