problem with rubygems , " no such file to load "

  • Thread starter Frioffol Friofool
  • Start date
F

Frioffol Friofool

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

[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 !
 
S

Stefan Lang

2008/8/4 Frioffol Friofool said:
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

[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 ?

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
 
F

Frioffol Friofool

Stefan said:
2008/8/4 Frioffol Friofool said:
[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
 
S

Stefan Lang

2008/8/4 Frioffol Friofool said:
Stefan said:
2008/8/4 Frioffol Friofool said:
[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=C3=BB 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
 
F

Frioffol Friofool

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 ?
 
S

Stefan Lang

2008/8/4 Frioffol Friofool said:
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 ?

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/

If everything else fails, open a new shell.

Stefan
 
F

Frioffol Friofool

Stefan said:
2008/8/4 Frioffol Friofool said:
[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/

If everything else fails, open a new shell.

Stefan

all is working fine...

thanks a lot for your help.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,039
Messages
2,570,376
Members
47,028
Latest member
IsmaelLans

Latest Threads

Top