# Problems installing rubygems -No such file to load: rubygems

**URL:** <https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648>\
**Category:** Rails\
**Created:** [March 11, 2006, 12:36am UTC](https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648 "2006-03-11T00:36:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Egan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@David\_Egan](https://www.ruby-forum.com/u/David_Egan)\
**Post date:** [March 11, 2006, 12:36am UTC](https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648/1 "2006-03-11T00:36:50Z")

</div>

Hi,

I’m a bit of a beginner at this and I’m having some problems with  
installation, hopefully someone can help.

I’m following the guide for setting up under Mac OS X at

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

. I follow the tutorial all the way through without any errors but when  
it comes to the MySQL Native Bindings step I get an error saying:

/usr/local/bin/gem:3:in `require’: No such file to load – rubygems  
(LoadError)  
from /usr/local/bin/gem:3

I thought it would be alright to skip this step since it is not  
required, but when I try and start the server I get the same error. I  
ran through the steps of the tutorial again in case I had missed  
something the first time but the error is still there.

Any help would be great.

Thanks

---

<div class="post-metadata">

**Author:** ![David\_Egan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@David\_Egan](https://www.ruby-forum.com/u/David_Egan)\
**Post date:** [March 11, 2006, 1:04am UTC](https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648/2 "2006-03-11T01:04:03Z")

</div>

David Egan wrote:

> Hi,
> 
> I’m a bit of a beginner at this and I’m having some problems with  
> installation, hopefully someone can help.
> 
> I’m following the guide for setting up under Mac OS X at  
> [Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)  
> . I follow the tutorial all the way through without any errors but when  
> it comes to the MySQL Native Bindings step I get an error saying:
> 
> /usr/local/bin/gem:3:in `require’: No such file to load – rubygems  
> (LoadError)  
> from /usr/local/bin/gem:3

Sounds like in the RubyGems section, instead of:

sudo /usr/local/bin/ruby setup.rb

you typed

sudo ruby setup.rb

and the rb files for rubygems have been installed somewhere else (the  
tiger default ruby, rather than the /usr/local/bin one).

Strange that gem install rails worked, though…

If you still have the source (even if you don’t) I’d go back to that  
step in the hivelogic tutorial. I follwed it to the letter on a newly  
wiped Tiger Powerbook and it all worked like a charm.

A.

---

<div class="post-metadata">

**Author:** ![David\_Egan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@David\_Egan](https://www.ruby-forum.com/u/David_Egan)\
**Post date:** [March 11, 2006, 1:47am UTC](https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648/3 "2006-03-11T01:47:20Z")

</div>

Alan F. wrote:

> David Egan wrote:
> 
> > Hi,
> > 
> > I’m a bit of a beginner at this and I’m having some problems with  
> > installation, hopefully someone can help.
> > 
> > I’m following the guide for setting up under Mac OS X at  
> > [Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)  
> > . I follow the tutorial all the way through without any errors but when  
> > it comes to the MySQL Native Bindings step I get an error saying:
> > 
> > /usr/local/bin/gem:3:in `require’: No such file to load – rubygems  
> > (LoadError)  
> > from /usr/local/bin/gem:3
> 
> Sounds like in the RubyGems section, instead of:
> 
> sudo /usr/local/bin/ruby setup.rb
> 
> you typed
> 
> sudo ruby setup.rb
> 
> and the rb files for rubygems have been installed somewhere else (the  
> tiger default ruby, rather than the /usr/local/bin one).
> 
> Strange that gem install rails worked, though…
> 
> If you still have the source (even if you don’t) I’d go back to that  
> step in the hivelogic tutorial. I follwed it to the letter on a newly  
> wiped Tiger Powerbook and it all worked like a charm.
> 
> A.

I’ve rerun everything in the tutorial and this time I made sure that I  
entered everything exactly as it is on the page. Still have the same  
error message. Is it possible that it is conflicting with something else  
on my system given that exactly the same instructions appear to have  
worked for others. And if so how would I check for a conflict.

Thanks.

---

<div class="post-metadata">

**Author:** ![David\_Egan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@David\_Egan](https://www.ruby-forum.com/u/David_Egan)\
**Post date:** [March 15, 2006, 4:43pm UTC](https://www.ruby-forum.com/t/problems-installing-rubygems-no-such-file-to-load-rubygems/54648/4 "2006-03-15T16:43:21Z")

</div>

David Egan wrote:

> I’ve rerun everything in the tutorial and this time I made sure that I  
> entered everything exactly as it is on the page. Still have the same  
> error message. Is it possible that it is conflicting with something else  
> on my system given that exactly the same instructions appear to have  
> worked for others. And if so how would I check for a conflict.
> 
> Thanks.

It’s VERY weird that

sudo gem install rails

would find rubygems okay, but

sudo gem install mysql

wouldn’t.

What do you get if you just type sudo gem install mysql ? If you try  
and install another few gems, what happens ?

e.g.

sudo gem install capistrano  
sudo gem install redcloth

If all are well, I’d have to go with the tricksy arguments theory. Have  
you triple checked the additional args when installing mysql ?

sudo gem install mysql   
with-mysql-dir=/usr/local/mysql

A.
