[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Please help fixing gems on OSX

Dan Uznanski

12/19/2006 7:44:00 AM

Over the past few months, several people have posted on various mailing
lists, including this one, that their rubygems install on OSX fails
with the following error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
`initialize': uninitialized constant Gem::CommandManager::HelpCommand
(NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`new'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`instance'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in
`run'
from /usr/local/bin/gem:23

I have discovered the cause of this error, at least on my machine, but
not the final underlying cause.

in $LIBDIR/ruby/site_ruby/1.8/rubygems/, there is a file named
gem_commands.rb ; on my machine, this file was empty. However, there
was also gem_commands.1.rb , which contained the original content of
gem_commands.rb . To fix the error, simply move gem_commands.1.rb onto
gem_commands.rb .

Thanks go to LoganCapaldo on IRC for being patient with me and guiding
me through the sub-basement levels of Ruby's library system.

Dan Uznanski


4 Answers

Eric Hodel

12/19/2006 9:54:00 AM

0

On Dec 18, 2006, at 23:43, Dan Uznanski wrote:

> Over the past few months, several people have posted on various
> mailing lists, including this one, that their rubygems install on
> OSX fails with the following error:
>
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
> `initialize': uninitialized constant
> Gem::CommandManager::HelpCommand (NameError)
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:
> 46:in `new'
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:
> 46:in `instance'
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in
> `run'
> from /usr/local/bin/gem:23
>
> I have discovered the cause of this error, at least on my machine,
> but not the final underlying cause.
>
> in $LIBDIR/ruby/site_ruby/1.8/rubygems/, there is a file named
> gem_commands.rb ; on my machine, this file was empty. However,
> there was also gem_commands.1.rb , which contained the original
> content of gem_commands.rb . To fix the error, simply move
> gem_commands.1.rb onto gem_commands.rb .

I'd like to know how this happens because I certainly haven't been
able to reproduce it. I suspect something happened before install,
not after.

I'd especially like to see `ls -l lib/rubygems` from the unpacked
tarball that produced this install, and I'd like to see the md5 hash
of the downloaded tarball.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


Eric Hodel

12/19/2006 10:20:00 AM

0

On Dec 19, 2006, at 01:53, Eric Hodel wrote:
> On Dec 18, 2006, at 23:43, Dan Uznanski wrote:
>
>> Over the past few months, several people have posted on various
>> mailing lists, including this one, that their rubygems install on
>> OSX fails with the following error:
>>
>> /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
>> `initialize': uninitialized constant
>> Gem::CommandManager::HelpCommand (NameError)
>> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:
>> 46:in `new'
>> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:
>> 46:in `instance'
>> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:
>> 25:in `run'
>> from /usr/local/bin/gem:23
>>
>> I have discovered the cause of this error, at least on my machine,
>> but not the final underlying cause.
>>
>> in $LIBDIR/ruby/site_ruby/1.8/rubygems/, there is a file named
>> gem_commands.rb ; on my machine, this file was empty. However,
>> there was also gem_commands.1.rb , which contained the original
>> content of gem_commands.rb . To fix the error, simply move
>> gem_commands.1.rb onto gem_commands.rb .
>
> I'd like to know how this happens because I certainly haven't been
> able to reproduce it. I suspect something happened before install,
> not after.
>
> I'd especially like to see `ls -l lib/rubygems` from the unpacked
> tarball that produced this install, and I'd like to see the md5
> hash of the downloaded tarball.

Note that there's a bug open on this:

http://rubyforge.org/tracker/...
func=detail&aid=6097&group_id=126&atid=575

If you can reproduce, please note that there, including the above
information.

--
Eric Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!


Dan Uznanski

12/19/2006 10:36:00 AM

0


>
> I'd like to know how this happens because I certainly haven't been
> able to reproduce it. I suspect something happened before install,
> not after.

> I'd especially like to see `ls -l lib/rubygems` from the unpacked
> tarball that produced this install, and I'd like to see the md5 hash
> of the downloaded tarball.
>
>

md5 sum of rubygems-0.9.0.tgz: 5d496e1f415b8b4033ab867f01d1161f (174321
bytes)

of note in tar -zxvf rubygems-0.9.0.tgz: both the Rakefile and
gem_commands.rb show up twice:

rubygems-0.9.0/._Rakefile
rubygems-0.9.0/Rakefile

rubygems-0.9.0/lib/rubygems/._gem_commands.rb
rubygems-0.9.0/lib/rubygems/gem_commands.rb

of note in ls -lr of the original attempted install: both Rakefile and
gem_commands.rb show up twice, like this:
:
-rwxr-xr-x 1 vorn staff 0 17 Dec 15:06 Rakefile
-rw-r--r-- 1 vorn staff 9330 28 Jun 07:42 Rakefile.1

/lib/rubygems:
-rw-r--r-- 1 vorn staff 41032 21 Jun 20:44 gem_commands.1.rb
-rwxr-xr-x 1 vorn staff 0 17 Dec 15:06 gem_commands.rb

I'm not sure, but I believe the original decompression (though I don't
recall how it was done - perhaps my browser did it for me? it's the
latest release Safari under 10.3.9) "cleaned up" the filenames of
lib/rubygems/._gem_commands.rb and of ._Rakefile, then renamed the
subsequent "real" ones in usual Mac style so as not to stomp.

_gem_commands.rb and ._Rakefile are identical binary files. file says
it's an "AppleDouble encoded Macintosh file". Here is a hexdump.
0000000 0005 1607 0002 0000 4d61 6320 4f53 2058
0000010 2020 2020 2020 2020 0002 0000 0009 0000
0000020 0032 0000 0020 0000 0002 0000 0052 0000
0000030 0000 0000 0000 454d 4178 0000 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000

I will now go post all this under the bug report too. My proposed
solution: if these two files are not necessary for the installation,
remove them!

Dan


Eric Hodel

12/19/2006 6:25:00 PM

0

On Dec 19, 2006, at 02:35, Dan Uznanski wrote:

>> I'd like to know how this happens because I certainly haven't been
>> able to reproduce it. I suspect something happened before
>> install, not after.
>>
>> I'd especially like to see `ls -l lib/rubygems` from the unpacked
>> tarball that produced this install, and I'd like to see the md5
>> hash of the downloaded tarball.
>
> md5 sum of rubygems-0.9.0.tgz: 5d496e1f415b8b4033ab867f01d1161f
> (174321 bytes)
>
> of note in tar -zxvf rubygems-0.9.0.tgz: both the Rakefile and
> gem_commands.rb show up twice:
>
> rubygems-0.9.0/._Rakefile
> rubygems-0.9.0/Rakefile
>
> rubygems-0.9.0/lib/rubygems/._gem_commands.rb
> rubygems-0.9.0/lib/rubygems/gem_commands.rb

The OS X built-in tar gets this right, stuffit expander gets this
wrong. File a bug with stuffit for creating files that don't exist (.
1.rb).

--
Eric Hodel - drbrain@segment7.net - http://blog.se...

I LIT YOUR GEM ON FIRE!