Forum: Ruby Rubygem install "Invalid argument - sources-0.0.1.gem"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-01-26 15:05
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 !
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-01-27 23:05
(Received via mailing list)
On Jan 26, 2007, at 06:05, Jeremy Lecour wrote:

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

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

I LIT YOUR GEM ON FIRE!
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-01-28 09:11
Eric Hodel wrote:
> 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 !
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-01-30 09:38
Is there any lead around here ?
I'm completly stuck :(

Thanks
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-01-30 16:35
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.
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-06 10:29
Hi, I get the same with rubtgems 0.9.2

I think I'm very unlucky !


>> ruby -d setup.rb
>
> 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
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-02-06 21:41
(Received via mailing list)
On Jan 28, 2007, at 24:11, Jeremy Lecour wrote:
> /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]'
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-06 22:48
> 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
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-02-07 02:09
(Received via mailing list)
On Feb 6, 2007, at 13:49, Jeremy Lecour wrote:
>    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.
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-07 09:56
> First, site_ruby should be under /usr/local/lib/ruby, not /usr/local/
> lib.

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
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-07 09:59
Jeremy Lecour wrote:
>> First, site_ruby should be under /usr/local/lib/ruby, not /usr/local/
>> lib.
>
> 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.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-02-07 23:14
(Received via mailing list)
On Feb 7, 2007, at 24:59, Jeremy Lecour wrote:
>> know
>> which way.
>>
>> Thanks for your help
>
> 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.
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
stdruby.  No other files belong there.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2007-02-07 23:14
(Received via mailing list)
On Feb 7, 2007, at 24:56, Jeremy Lecour wrote:
>> First, site_ruby should be under /usr/local/lib/ruby, not /usr/local/
>> lib.
>
> 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/"

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
Ruby was configured.
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-08 09:15
Eric Hodel wrote:
> 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

>> 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
> stdruby.  No other files belong there.

OK
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-08 09:28
Eric Hodel wrote:
>> 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/"
>
> 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

>> 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
> 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.
7d1caf9df777b3b2cf474ff743494335?d=identicon&s=25 Jeremy Lecour (eboss)
on 2007-02-08 11:50
Jeremy Lecour wrote:
> 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) ?
This topic is locked and can not be replied to.