PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Gems gone due to bad $:
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Gems gone due to bad $:

Réponse
 
LinkBack Outils de la discussion
Vieux 09/01/2008, 05h53   #1
gga
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Gems gone due to bad $:


On an Ubuntu box.

I have been experimenting with ruby1.9 and now I am finding that gems
are gone from 1.8. It seems by RUBYLIB path is never modified.

I don't know if that had anything to do with it or an update of the OS
screwed up something.

$ ls /usr/lib/ruby/gems/1.8/
gems/
(all gems are listed)

$ type ruby
ruby is /usr/bin/ruby

$ ls -l /usr/bin/ruby
lrwxrwxrwx 1 root root 7 2007-04-23 07:58 /usr/bin/ruby -> ruby1.8

$ type irb1.8
/usr/bin/irb1.8

$ head -n1 /usr/bin/irb1.8
#!/usr/bin/ruby1.8

$ /usr/bin/ruby1.8 --version
ruby 1.8.6 (2007-06-07 patchlevel 36) [x86_64-linux]


$ export RUBYOPT='-w -rubygems'

$ irb1.8

irb> $:
=> ["/home/gga/ruby/libs", "/home/gga/ruby/libs", "/usr/local/lib/
site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/
local/lib/site_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-
linux", "."]

irb> require 'rubygems'
=> false

irb> require 'rails'
LoadError: no such file to load -- rails


$ gem --version
0.9.4

Can anyone me revert back to a working rubygems?
  Réponse avec citation
Vieux 09/01/2008, 17h34   #2
Ckvok Kovsky
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Gems gone due to bad $:

3.3 No such file to load -- rubygems

When I run the gem command, I get the following error message:

ruby: No such file to load -- rubygems (LoadError)

What’s wrong?
Answer

It looks like executing copy of Ruby does not have the RubyGems library
installed. RubyGems was probably installed at one time (because the gem
command is recognized), but it may have been installed on a different
installation of Ruby than the one you are currently running.
Things to check

* Check that the installation of Ruby that is running is the same
one that has RubyGems installed. On a unix system, the which command (or
type command) will figure this out.

* Verify that the currently running installation of Ruby does indeed
have the RubyGems library installed. You should find a “rubygems.rbâ€
file in the site_ruby/1.8 directory of the Ruby installation.

These mixup can easily happen after installing a new instance of Ruby,
but the old instance preceeds the new one in the PATH list.

http://rubygems.org/read/chapter/19
-------
Usually uninstalling all packages and installing them again (except 1.9
pkg) fix things.
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 10/01/2008, 22h53   #3
Wirianto Djunaidi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Gems gone due to bad $:

gga wrote:
> On an Ubuntu box.
>
> I have been experimenting with ruby1.9 and now I am finding that gems
> are gone from 1.8. It seems by RUBYLIB path is never modified.
>
> I don't know if that had anything to do with it or an update of the OS
> screwed up something.
>
> $ ls /usr/lib/ruby/gems/1.8/
> gems/
> (all gems are listed)
>
> $ type ruby
> ruby is /usr/bin/ruby
>
> $ ls -l /usr/bin/ruby
> lrwxrwxrwx 1 root root 7 2007-04-23 07:58 /usr/bin/ruby -> ruby1.8
>
> $ type irb1.8
> /usr/bin/irb1.8
>
> $ head -n1 /usr/bin/irb1.8
> #!/usr/bin/ruby1.8
>
> $ /usr/bin/ruby1.8 --version
> ruby 1.8.6 (2007-06-07 patchlevel 36) [x86_64-linux]
>
>
> $ export RUBYOPT='-w -rubygems'
>
> $ irb1.8
>
> irb> $:
> => ["/home/gga/ruby/libs", "/home/gga/ruby/libs", "/usr/local/lib/
> site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/
> local/lib/site_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-
> linux", "."]
>
> irb> require 'rubygems'
> => false
>
> irb> require 'rails'
> LoadError: no such file to load -- rails
>
>
> $ gem --version
> 0.9.4
>
> Can anyone me revert back to a working rubygems?
>
>

On my ubuntu box when installing gems using the package manager, the
default path for gems is under /var/lib/gems


  Réponse avec citation
Vieux 10/01/2008, 23h00   #4
Ryan Davis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Gems gone due to bad $:


On Jan 8, 2008, at 21:55 , gga wrote:

> irb> require 'rubygems'
> => false
>
> irb> require 'rails'
> LoadError: no such file to load -- rails


Expected behavior:

% gem list rails; ruby -v -e 'require "rubygems"; require "rails"'

*** LOCAL GEMS ***

rails (1.2.6)

ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- rails (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from -e:1


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13198 seconds with 12 queries