views:

60

answers:

3

while installing any Gem or doing any listing of gem gzip related error comes as shown below:-

C:\Documents and Settings\gangunra>gem install rhosync -v 2.0.0.beta7 --pre ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

C:\Documents and Settings\gangunra>gem list rails -r

* REMOTE GEMS *

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

Please help me out how to reslove this

A: 

Looks like rubygems.org (or any gem source you have defined) is down.

Eimantas
A: 

Make sure you are using the right Gem sources.

$ gem sources

should display http://rubygems.org as the first source.

If missing, add http://rubygems.org as the main source. Otherwise, it might be a temporary issue with RubyGems index.

Also make sure you are using the latest RubyGems (library) version.

$ gem update --system
Simone Carletti
after running $ gem sourcesoutput is *** CURRENT SOURCES ***http://gems.rubyforge.org/http://gems.github.comafter running $gem update --systemoutput will be ** REMOTE GEMS ***ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format
Ravindra
Clear all existing Gem sources using the `$ gem sources` command, then add `http://rubygems.org` as the first source. `gems.rubyforge.org` is the legacy URL.
Simone Carletti
As per your suggestion i had made the following changes then also same problemC:\Documents and Settings\gangunra>gem sources*** CURRENT SOURCES ***http://rubygems.org/C:\Documents and Settings\gangunra>gem update --systemUpdating RubyGemsERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format
Ravindra
A: 

Find out where your ruby is configured to look for sources:

C:\>gem sources
*** CURRENT SOURCES ***

http://gems.rubyforge.org/

If it is pointed at gems.rubyforge.org (which it is when first installed for older installation binaries) then you’re pointed at the old web server so when ruby tries to get updates it gets an HTTP redirect (302) as a response instead of the expected data in GZIP format. It apparently doesn’t have an error handler configured to detect the redirect so it just gives up.

To fix it you have to update the list of sources. First add the correct source:

C:\>gem sources -a http://rubygems.org/
http://rubygems.org/ added to sources

Then remove the deprecated one:

C:\>gem sources -r http://gems.rubyforge.org/
http://gems.rubyforge.org/ removed from sources

C:\>gem sources
*** CURRENT SOURCES ***

http://rubygems.org/

Next update your ruby system:

C:\>gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
:0:Warning: Gem::SourceIndex#search support for String patterns is deprecated
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed

=== 1.3.7 / 2010-05-13

NOTE:

http://rubygems.org is now the default source for downloading gems.

You may have sources set via ~/.gemrc, so you should replace
http://gems.rubyforge.org with http://rubygems.org

http://gems.rubyforge.org will continue to work for the forseeable future.
...

Note that update verifies that the old source URL is no longer valid…

You should now be able to continue your installation, which in my case was rake.

Handcraftsman