No matter on which OS you are, - XP Family, XP Pro or Ubuntu 9.10. No
matter if you have firewall ‘hyper-sensitive’ or proxy. When trying to
do gem update --system or even when trying to install a new gem like
'gem install [gem_name] I always got the below error:
serge@serge-laptop:~$ sudo gem install heroku
ERROR: Error installing heroku:
invalid gem format for /usr/lib/ruby/gems/1.8/cache/heroku-1.4.gem
serge@serge-laptop:~$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
serge@serge-laptop:~$ gem -v
1.3.5
I always get the above error of ‘…invalid gem format…’. Any idea how
to resolve that? Something goes wrong in rubygems
commits/dependencies?Thank you.
On Sat, Dec 05, 2009 at 12:22:41AM +0900, Serguei C. wrote:
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
serge@serge-laptop:~$ gem -v
1.3.5
I always get the above error of ‘…invalid gem format…’. Any idea how
to resolve that? Something goes wrong in rubygems
commits/dependencies?Thank you.
Does this break with any other gem? Or is it only the heroku gem?
On Sat, Dec 05, 2009 at 12:22:41AM +0900, Serguei C. wrote:
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
serge@serge-laptop:~$ gem -v
1.3.5
I always get the above error of ‘…invalid gem format…’. Any idea how
to resolve that? Something goes wrong in rubygems
commits/dependencies?Thank you.
Does this break with any other gem? Or is it only the heroku gem?
With any other gem, even when I tried from installing Ruby, then doing
(On Windows or Ubuntu - it was the same):
gem update --system
Updating RubyGems
Updating rubygems-update
ERROR: While executing gem … (Gem::InstallError)
invalid gem format for
C:/Ruby/lib/ruby/gems/1.8/cache/rubygems-update-1.3.5
.gem
Installing fromlocal rubygems-update-1.3.5 didn’t solve the problem.
Only the error message changed. Instead of
then, from the command line where you downloaded that file:
gem install rubygems-update-1.3.5.gem
If doesn’t work, then you’re behind a firewall or proxy that is
blocking all the Amazon S3 downloads and is downloading garbage that
RubyGems cannot install
I think I found the reason. I just opened the file that Ruby pointed in
(C:/Ruby/lib/ruby/gems/1.8/cache/[gem_name]. Here is what was inside (I
had to do that much earlier without loosing so much time :(:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head><body><header>
</header>
<center><img src="http://192.168.50.254:7000/blocked.jpg">
<p><b>This website is blocked.</b></p>
<p><b>To unlock it's content, please send a request to <a
href="mailto:[email protected]">[email protected]</a></b></p>
</center>
</body></html>
As you can see, the problem was that Ruby tried to go through the port
7000 that was blocked by the enterprise firewall.
Just to be sure at 100%, I took 2 laptops: with Windows XP Family and
Ubuntu 9.10 and tried to install RoR environment at home where I know
exactly my firewall configuration. And, as I expected, everything was
installed without any problem.
Thank you so much for your help. I’d like that Ruby error message to be
more user-friendly, like that one could get an idea more quickly where
to search.
That’s why it was clear that it was blocked by firewall. And right after
that, I decided to check the file
C:/Ruby/lib/ruby/gems/1.8/cache/[gem_name] and saw the port number.
Thank you again.
installed without any problem.
Thank you so much for your help. I'd like that Ruby error message to be
more user-friendly, like that one could get an idea more quickly where
to search.
It was pointed several times over this thread and by others that you
may be behind a firewall.
A proper firewall shouldn’t return HTTP 200 OK but instead something
else.
The problem is not Ruby, but the firewall, how can RubyGems determine
what will do so many proxy/firewalls in relation to blocking of
content?
That’s why it was clear that it was blocked by firewall. And right after
that, I decided to check the file
C:/Ruby/lib/ruby/gems/1.8/cache/[gem_name] and saw the port number.
Thank you again.
I googled so much but didn’t find any info describing the port number
that gem command usually used to connect to the repository. I thought it
was always 80 when usin cmd prompt or terminal window. Have you ever
heard anything about that?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.