# Problem with rubygems , " no such file to load "

**URL:** <https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949>\
**Category:** Ruby\
**Created:** [August 4, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949 "2008-08-04T16:57:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/1 "2008-08-04T16:57:57Z")

</div>

Hi !

I’m doing a new installation of rails , but i get a big problem with  
rubygem :

[root@compute test\_projet\_rails]# ruby script/console

Rails requires RubyGems \>= 0.9.4. Please install RubyGems and try again:  
[http://rubygems.rubyforge.org](http://rubygems.rubyforge.org)

[root@compute test\_projet\_rails]# gem -v

1.2.0

[root@compute test\_projet\_rails]# irb

irb(main):001:0\> require ‘rubygems’  
LoadError: no such file to load – rubygems  
from (irb):1:in `require’  
from (irb):1  
irb(main):002:0\>

What’s wrong with my configuration ?

Thanks !

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/2 "2008-08-04T17:54:25Z")

</div>

2008/8/4 Frioffol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> [root@compute test\_projet\_rails]# gem -v
> 
> What’s wrong with my configuration ?

Maybe you have two Ruby installations. The one that is started by “ruby”  
and “irb” doesn’t have a gem installation. The one that the “gem”  
command  
uses, does.

Compare the output of:

```
$ cat `which gem` | head -n 1

$ ls -l `which ruby`

```

Stefan

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 6:58pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/3 "2008-08-04T18:58:23Z")

</div>

Stefan L. wrote:

> 2008/8/4 Frioffol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > [root@compute test\_projet\_rails]# gem -v
> > 
> > What’s wrong with my configuration ?
> 
> Maybe you have two Ruby installations. The one that is started by “ruby”  
> and “irb” doesn’t have a gem installation. The one that the “gem”  
> command  
> uses, does.
> 
> Compare the output of:
> 
> ```
> $ cat `which gem` | head -n 1
> 
> $ ls -l `which ruby`
> 
> ```
> 
> Stefan

bingo !  
that was the problem…

[root@compute test\_projet\_rails]# cat `which gem` | head -n 1  
#!/usr/bin/ruby  
[root@compute test\_projet\_rails]# ls -l `which ruby`  
-rwxr-xr-x 1 root root 1931641 aoÃƒÂ» 1 11:40 /usr/local/bin/ruby

but how can i update the path and use just one ruby version ?

i tried to install ruby sources first but for different reasons, i use  
the fedora installer ‘yum’.

i’m not an expert in system and i need some help…

thanks a lot

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/4 "2008-08-04T21:06:25Z")

</div>

thanks to take all this time to help me…

this is better, after i removed the compiled version i get that :

[root@compute src]# cat `which gem` | head -n 1  
#!/usr/bin/ruby  
[root@compute src]# ls -l `which ruby`  
-rwxr-xr-x 1 root root 3748 jui 1 10:33 /usr/bin/ruby

great ! but i when i try to run ruby that’s a drama…

[root@compute src]# ruby  
-bash: /usr/local/bin/ruby: No such file or directory

My path is :

/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

maybe another thing to do for updating the path ?

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/5 "2008-08-04T22:03:39Z")

</div>

2008/8/4 Frioffol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> [root@compute src]# ruby  
> -bash: /usr/local/bin/ruby: No such file or directory
> 
> My path is :
> 
> /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
> 
> maybe another thing to do for updating the path ?

Yes, bash caches the ruby → /usr/local/bin/ruby association.  
Here’s a description:  
[http://blog.byohosting.com/2008/01/17/how-to-clear-shell-command-path-cache/](http://blog.byohosting.com/2008/01/17/how-to-clear-shell-command-path-cache/)

If everything else fails, open a new shell.

Stefan

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 4, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/6 "2008-08-04T19:17:06Z")

</div>

2008/8/4 Frioffol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > 
> 
> [root@compute test\_projet\_rails]# cat `which gem` | head -n 1  
> #!/usr/bin/ruby  
> [root@compute test\_projet\_rails]# ls -l `which ruby`  
> -rwxr-xr-x 1 root root 1931641 aoÃ» 1 11:40 /usr/local/bin/ruby
> 
> but how can i update the path and use just one ruby version ?
> 
> i tried to install ruby sources first but for different reasons, i use  
> the fedora installer ‘yum’.

It seems that you have one ruby that was installed by your package  
manager (the /usr/bin/ruby one) and one manual installation.

It is not a good idea to remove the one installed by the package  
manager because other packages might depend on it.

You can remove the manual installation by deleting ruby, ri, rdoc,  
erb and testrb from /usr/local/bin and deleting everything with  
ruby in its name from /usr/local/lib.

OTOH, having two ruby installations is not a problem at all. Just  
keep in mind that /usr/local comes first in your path. If you  
want to use that, get & install the rubygems package from rubyforge.  
That installs a gem command in /usr/local which again should shadow  
the /usr/bin one.

Stefan

---

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [August 5, 2008, 9:58am UTC](https://www.ruby-forum.com/t/problem-with-rubygems-no-such-file-to-load/144949/7 "2008-08-05T09:58:51Z")

</div>

Stefan L. wrote:

> 2008/8/4 Frioffol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > [root@compute src]# ruby  
> > -bash: /usr/local/bin/ruby: No such file or directory
> > 
> > My path is :
> > 
> > /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
> > 
> > maybe another thing to do for updating the path ?
> 
> Yes, bash caches the ruby → /usr/local/bin/ruby association.  
> Here’s a description:  
> [http://blog.byohosting.com/2008/01/17/how-to-clear-shell-command-path-cache/](http://blog.byohosting.com/2008/01/17/how-to-clear-shell-command-path-cache/)
> 
> If everything else fails, open a new shell.
> 
> Stefan

all is working fine…

thanks a lot for your help.
