Rubygem install "Invalid argument - sources-0.0.1.gem"

J

Jeremy Lecour

Hi,

This morning, I wanted to upgrade my rubygems install : 0.9.0 -> 0.9.1

I've launched "ruby setup.rb" as root and got that at the end :

hook /var/www/rubygems-0.9.1/./post-install.rb failed:
Invalid argument - sources-0.0.1.gem
Try 'ruby setup.rb --help' for detailed usage.

I've messed with rubygems files trying to delete it and do a fresh
install but now I don't have any working version of rubygems.

It's the same if I try to re-install rubygems 0.9.0.

I'm on Debian testing.

Thanks for any help !
 
E

Eric Hodel

This morning, I wanted to upgrade my rubygems install : 0.9.0 -> 0.9.1

I've launched "ruby setup.rb" as root and got that at the end :

hook /var/www/rubygems-0.9.1/./post-install.rb failed:
Invalid argument - sources-0.0.1.gem
Try 'ruby setup.rb --help' for detailed usage.

What does:

ruby -d setup.rb

say when it gets to post-install.rb?
 
J

Jeremy Lecour

Eric said:
What does:

ruby -d setup.rb

say when it gets to post-install.rb?

I get this :

Exception `Errno::EINVAL' at
/usr/local/lib/site_ruby/1.8/rubygems/package.rb:264 - Invalid argument
- sources-0.0.1.gem
Exception `Errno::EINVAL' at setup.rb:590 - Invalid argument -
sources-0.0.1.gem
Exception `SetupError' at setup.rb:40 - hook
/var/www/rubygems-0.9.1/./post-install.rb failed:
Invalid argument - sources-0.0.1.gem
Exception `SetupError' at setup.rb:1362 - hook
/var/www/rubygems-0.9.1/./post-install.rb failed:
Invalid argument - sources-0.0.1.gem
setup.rb:40:in `setup_rb_error': hook
/var/www/rubygems-0.9.1/./post-install.rb failed: (SetupError)
Invalid argument - sources-0.0.1.gem from setup.rb:592:in
`try_run_hook'
from setup.rb:584:in `run_hook'
from setup.rb:1322:in `exec_task_traverse'
from setup.rb:1175:in `exec_install'
from setup.rb:894:in `exec_install'
from setup.rb:712:in `invoke'
from setup.rb:681:in `invoke'
from setup.rb:1359


Thanks for your help !
 
J

Jeremy Lecour

Hi,

I forgot to say that the computer is a Sun Enterprise 220R : dual
Sparc64.

I don't think it's important because I managed to install rubygems 0.9.0
once without any problem and now 0.9.0 and 0.9.1 are not working.
 
E

Eric Hodel

I get this :

Exception `Errno::EINVAL' at
/usr/local/lib/site_ruby/1.8/rubygems/package.rb:264 - Invalid
argument
- sources-0.0.1.gem

Can you verify what the lines surrounding this line are?

cat -n /usr/local/lib/site_ruby/1.8/rubygems/package.rb | grep '26[0-9]'
 
J

Jeremy Lecour

cat -n /usr/local/lib/site_ruby/1.8/rubygems/package.rb | grep '26[0-9]'

260 final_pos = @io.pos
261 @io.pos = init_pos
262 header = TarHeader.new:)name => name, :mode => mode,
263 :size => size, :prefix =>
prefix).to_s
264 @io.write header
265 @io.pos = final_pos
266 end
267
268 def mkdir(name, mode)
269 raise ClosedIO if @closed


Thanks for your answer
 
E

Eric Hodel

cat -n /usr/local/lib/site_ruby/1.8/rubygems/package.rb | grep '26
[0-9]'

260 final_pos = @io.pos
261 @io.pos = init_pos
262 header = TarHeader.new:)name => name, :mode => mode,
263 :size => size, :prefix =>
prefix).to_s
264 @io.write header
265 @io.pos = final_pos
266 end
267
268 def mkdir(name, mode)
269 raise ClosedIO if @closed

Hrm, it seems that something bogus is going on with your installation.

First, site_ruby should be under /usr/local/lib/ruby, not /usr/local/
lib.

Second, line 264 should be "@io.pos = final_pos", not what you've got.

Can you try removing /usr/local/lib/site_ruby/1.8/rubygems.rb and /
usr/local/lib/site_ruby/1.8/rubygems/* and reinstalling? I suspect
those files are from an older version of RubyGems and are getting in
the way.
 
J

Jeremy Lecour

First, site_ruby should be under /usr/local/lib/ruby, not /usr/local/

I've removed everything, including ruby itself, …
when I do "apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
libreadline-ruby1.8 libruby1.8", I get things in "/usr/lib/ruby/1.8/"

I thing I have to tune the setup config for Rubygems, but I don't know
which way.

Thanks for your help
 
J

Jeremy Lecour

Jeremy said:
I've removed everything, including ruby itself, …
when I do "apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
libreadline-ruby1.8 libruby1.8", I get things in "/usr/lib/ruby/1.8/"

I thing I have to tune the setup config for Rubygems, but I don't know
which way.

Thanks for your help

If do "ruby setup.rb config" then "ruby setup.rb show" :
prefix /usr
bindir $prefix/bin
libdir $prefix/lib
datadir $prefix/share
mandir $prefix/share/man
sysconfdir /etc
stdruby $libdir/ruby/1.8
siteruby $prefix/local/lib/site_ruby
siterubyver $siteruby/1.8
siterubyverarch $siterubyver/sparc-linux
rbdir $siterubyver
sodir $siterubyverarch
rubypath /usr/bin/ruby1.8
rubyprog /usr/bin/ruby1.8
makeprog make
shebang ruby
without-ext no

But I don't understand why it is using "siteruby" instead of "stdruby"
which seems to be right for me.
 
E

Eric Hodel

If do "ruby setup.rb config" then "ruby setup.rb show" :
stdruby $libdir/ruby/1.8
siteruby $prefix/local/lib/site_ruby
siterubyver $siteruby/1.8

Since this is how your ruby was configured, its fine, but a bit odd. =20=

So long as rbconfig is self-consistent it should work fine.
But I don't understand why it is using "siteruby" instead of "stdruby"
which seems to be right for me.

Nothing but Ruby's "make install" should install things in to =20
stdruby. No other files belong there.=20
=20=
 
E

Eric Hodel

I've removed everything, including ruby itself, =85
when I do "apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
libreadline-ruby1.8 libruby1.8", I get things in "/usr/lib/ruby/1.8/"

Did RubyGems install successfully now?
I thing I have to tune the setup config for Rubygems, but I don't know
which way.

You shouldn't, it follows what rbconfig says, which depends upon how =20
Ruby was configured.
 
J

Jeremy Lecour

Eric said:
Since this is how your ruby was configured, its fine, but a bit odd.
So long as rbconfig is self-consistent it should work fine.

It seems to be the standard config for the Ruby Debian package
Nothing but Ruby's "make install" should install things in to
stdruby. No other files belong there.

OK
 
J

Jeremy Lecour

Eric said:
Did RubyGems install successfully now?

No !! I have the exact same error, with 0.9.[0-2]

I even tried to install the official Debian package for rubygems. Then :

# gem -v
0.9.0

# gem update --system
Updating RubyGems...
Bulk updating Gem source index for: http://gems.rubyforge.org
Attempting remote update of rubygems-update
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - /var/lib/gems/1.8/cache/rubygems-update-0.9.2.gem

# gem pristine --all
ERROR: While executing gem ... (RuntimeError)
Unknown command pristine

# gem install rubygems-update
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - /var/lib/gems/1.8/cache/rubygems-update-0.9.2.gem
You shouldn't, it follows what rbconfig says, which depends upon how
Ruby was configured.

OK I undestand the logic, but still, I'm stuck and begin to be desperate

I'm sorry the bother you with my strange problem, but for now you are my
only help out there. Thanks again.
 
J

Jeremy Lecour

Jeremy said:
Hi,

I forgot to say that the computer is a Sun Enterprise 220R : dual
Sparc64.

I don't think it's important because I managed to install rubygems 0.9.0
once without any problem and now 0.9.0 and 0.9.1 are not working.

There is definitly a problem with the Ruby Debian package.

On a clone (hardware) server with a minimal Debian, the problem is the
same.

BUT if i install Ruby from sources, I get no problem at all ; rubygems
is installed and is self-updated.

I hope I can get back to Debian packages soon when it's solved.

Where could I submit the "bug" (or whatever it really is) ?
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top