tag:help.rubygems.org,2010-01-19:/discussions/problems/543-gems-not-installing-because-of-invalid-stored-block-lengthsRubyGems.org: Discussion 2018-10-18T19:51:05Ztag:help.rubygems.org,2010-01-19:Comment/64014432011-04-02T21:54:31Z2011-04-02T21:54:31ZGems not installing because of "invalid stored block lengths"<div><p>Please provide exact output that you're getting, including the
output of <code>gem env</code> and the output of the gem
installation process with <code>--debug -V</code> options.</p>
<p>That way we are going to be able to help you better.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/64014432011-04-03T16:55:05Z2011-05-24T06:26:22ZGems not installing because of "invalid stored block lengths"<div><p>I removed all traces of ruby and rubygems, and started over.
Here follows the complete output:</p>
<p>After a fresh install:</p>
<pre>
<code>daniel@daniel-experiment:~$ sudo apt-get install ruby rubygems
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libreadline-ruby1.9.1 libruby1.9.1 rdoc1.9.1 irb1.9.1 ruby1.9.1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
irb1.8 libreadline-ruby1.8 rdoc1.8 rubygems1.8
Suggested packages:
graphviz ruby1.8-dev rubygems-doc
The following NEW packages will be installed:
irb1.8 libreadline-ruby1.8 rdoc1.8 ruby rubygems rubygems1.8
0 upgraded, 6 newly installed, 0 to remove and 385 not upgraded.
Need to get 2,684B/431kB of archives.
After this operation, 2,265kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://za.archive.ubuntu.com/ubuntu/ lucid/universe rubygems 1.3.5-1ubuntu2 [2,684B]
Fetched 2,684B in 0s (14.0kB/s)
Selecting previously deselected package libreadline-ruby1.8.
(Reading database ... 125548 files and directories currently installed.)
Unpacking libreadline-ruby1.8 (from .../libreadline-ruby1.8_1.8.7.249-2_i386.deb) ...
Selecting previously deselected package irb1.8.
Unpacking irb1.8 (from .../irb1.8_1.8.7.249-2_all.deb) ...
Selecting previously deselected package rdoc1.8.
Unpacking rdoc1.8 (from .../rdoc1.8_1.8.7.249-2_all.deb) ...
Selecting previously deselected package ruby.
Unpacking ruby (from .../apt/archives/ruby_4.2_all.deb) ...
Selecting previously deselected package rubygems1.8.
Unpacking rubygems1.8 (from .../rubygems1.8_1.3.5-1ubuntu2_all.deb) ...
Selecting previously deselected package rubygems.
Unpacking rubygems (from .../rubygems_1.3.5-1ubuntu2_all.deb) ...
Processing triggers for man-db ...
Setting up libreadline-ruby1.8 (1.8.7.249-2) ...
Setting up irb1.8 (1.8.7.249-2) ...
Setting up rdoc1.8 (1.8.7.249-2) ...
Setting up ruby (4.2) ...
Setting up rubygems1.8 (1.3.5-1ubuntu2) ...
Setting up rubygems (1.3.5-1ubuntu2) ...</code>
</pre>
<p>And here is the environment info:</p>
<pre>
<code>daniel@daniel-experiment:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.7.1
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/daniel/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/</code>
</pre>
<p>The error I get:</p>
<pre>
<code>daniel@daniel-experiment:~$ sudo gem install rails
ERROR: While executing gem ... (Zlib::DataError)
invalid code lengths set</code>
</pre>
<p>And the verbose debug output of said error:</p>
<pre>
<code>daniel@daniel-experiment:~$ sudo gem install rails --debug -V
Exception `NameError' at /usr/local/lib/site_ruby/1.8/rubygems/command_manager.rb:163 - uninitialized constant Gem::Commands::InstallCommand
Exception `LoadError' at /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- psych
Exception `LoadError' at /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:60 - no such file to load -- psych
Exception `Gem::LoadError' at /usr/local/lib/site_ruby/1.8/rubygems.rb:925 - Could not find RubyGem sources (> 0.0.1)
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://rubygems.org/specs.4.8.gz
Exception `EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
Exception `EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:120 - end of file reached
Exception `EOFError' at /usr/lib/ruby/1.8/net/http.rb:1061 - end of file reached
connection reset after 2 requests, retrying
GET http://rubygems.org/specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/specs.4.8.gz
Exception `EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
Exception `EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:120 - end of file reached
Exception `EOFError' at /usr/lib/ruby/1.8/net/http.rb:1061 - end of file reached
connection reset after 2 requests, retrying
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
Installing gem railties-3.0.5
Exception `Zlib::DataError' at /usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:220 - invalid code lengths set
Exception `Zlib::DataError' at /usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:223 - invalid code lengths set
Exception `IOError' at /usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:24 - closed stream
ERROR: While executing gem ... (Zlib::DataError)
invalid code lengths set
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:223:in `finish'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:223:in `zipped_stream'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:130:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `loop'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:128:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/format.rb:66:in `from_io'
/usr/local/lib/site_ruby/1.8/rubygems/package/tar_input.rb:22:in `open'
/usr/local/lib/site_ruby/1.8/rubygems/package.rb:68:in `open'
/usr/local/lib/site_ruby/1.8/rubygems/format.rb:62:in `from_io'
/usr/local/lib/site_ruby/1.8/rubygems/format.rb:46:in `from_file_by_path'
/usr/local/lib/site_ruby/1.8/rubygems/format.rb:45:in `open'
/usr/local/lib/site_ruby/1.8/rubygems/format.rb:45:in `from_file_by_path'
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:413:in `load_gem_file'
/usr/local/lib/site_ruby/1.8/rubygems/installer.rb:103:in `initialize'
/usr/local/lib/site_ruby/1.8/rubygems/dependency_installer.rb:286:in `new'
/usr/local/lib/site_ruby/1.8/rubygems/dependency_installer.rb:286:in `install'
/usr/local/lib/site_ruby/1.8/rubygems/dependency_installer.rb:270:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/dependency_installer.rb:270:in `install'
/usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:120:in `execute'
/usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
/usr/local/lib/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
/usr/local/lib/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
/usr/local/lib/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
/usr/local/lib/site_ruby/1.8/rubygems/command_manager.rb:103:in `run'
/usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:64:in `run'
/usr/bin/gem:21</code>
</pre>
<p>I hope this tells you what the problem is. I already tried
downloading from the website, but that did not work either. Another
user had a similar problem.</p></div>danieltag:help.rubygems.org,2010-01-19:Comment/64014432011-04-05T20:31:14Z2011-04-05T20:31:14ZGems not installing because of "invalid stored block lengths"<div><pre>
<code>...
Setting up rubygems (1.3.5-1ubuntu2) …</code>
</pre>
<p>Followed by:</p>
<pre>
<code> - RUBYGEMS VERSION: 1.7.1</code>
</pre>
<p>So you're not using RubyGems 1.3.5.</p>
<p>If you're getting zlib data errors you have a problem with your
network or a broken install of ruby.</p></div>Eric Hodeltag:help.rubygems.org,2010-01-19:Comment/64014432011-05-23T21:44:53Z2011-05-23T21:44:53ZGems not installing because of "invalid stored block lengths"<div><p>Hello getack,</p>
<p>We haven't heard back from you on this issue.</p>
<p>Please let us know if you still have problems with this and none
of previous comments help you.</p>
<p>Going to close this in the upcoming days if there is no
feedback.</p>
<p>Thank you.</p></div>Luis Lavenatag:help.rubygems.org,2010-01-19:Comment/64014432011-05-24T06:26:13Z2011-05-24T06:27:01ZGems not installing because of "invalid stored block lengths"<div><p>Hello</p>
<p>Sorry for being so quiet lately. I've been crazy busy.</p>
<p>No I have not managed to get it running using the method
above.<br>
At the end I had to compile RVM from scratch, and use that to
compile and install ruby and gems.</p>
<p>Somewhere along the package stream there was a broken package,
and it messed up everything downstream. The fact that I compiled
most of it on my machine at the end, fixed it.</p>
<p>Thanks! :-)</p></div>daniel