[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

problem with rubygems , " no such file to load "

Frioffol Friofool

8/4/2008 2:57:00 PM

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.rub...

[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 !
--
Posted via http://www.ruby-....

6 Answers

Stefan Lang

8/4/2008 3:52:00 PM

0

2008/8/4 Frioffol Friofool <friofool@gmail.com>:
> 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.rub...
>
> [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

Frioffol Friofool

8/4/2008 4:57:00 PM

0

Stefan Lang wrote:
> 2008/8/4 Frioffol Friofool <friofool@gmail.com>:
>> [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

--
Posted via http://www.ruby-....

Stefan Lang

8/4/2008 5:15:00 PM

0

2008/8/4 Frioffol Friofool <friofool@gmail.com>:
> Stefan Lang wrote:
>> 2008/8/4 Frioffol Friofool <friofool@gmail.com>:
>>> [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

Frioffol Friofool

8/4/2008 7:05:00 PM

0

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 ?
--
Posted via http://www.ruby-....

Stefan Lang

8/4/2008 8:01:00 PM

0

2008/8/4 Frioffol Friofool <friofool@gmail.com>:
> 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-p...

If everything else fails, open a new shell.

Stefan

Frioffol Friofool

8/5/2008 7:58:00 AM

0

Stefan Lang wrote:
> 2008/8/4 Frioffol Friofool <friofool@gmail.com>:
>>
>> [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-p...
>
> If everything else fails, open a new shell.
>
> Stefan

all is working fine...

thanks a lot for your help.
--
Posted via http://www.ruby-....