Rubygems Problem on ubuntu 10.04

hello…

i have problem with rubygems version 1.8.7 on ubuntu 10.04 server LTS
64bit.this rubygems i also try both installation automatic using apt-get
package manager and using manually installation but the problem also
same.
the problem occur when i try to install any gems installation
package.i try many solution to solve the problem like remove and install
back rubygems.i also format computer then install back ruby and rubygems
but still cannot solve this problem.so i hope any rubygem expert can
help me solved this kind of problem.below are the following error that
appear after i execute gem install command.

sudo gem install any-package

ERROR: While executing gem … (Zlib::DataError)
incorrect header check.

and my environment for gems

[email protected]:~$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.8.10
  • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
  • INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: /usr/bin/ruby1.8
  • EXECUTABLE DIRECTORY: /usr/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /usr/lib/ruby/gems/1.8
    • /srv/cloud/one/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

Try to install dev lib for zlib:
$ sudo apt-get -y install zlib zlib-devel

Alex M. wrote in post #1029306:

Try to install dev lib for zlib:
$ sudo apt-get -y install zlib zlib-devel

thank for answer…

i already try this command but nothing is working…

below is addition information of my problem when i try to install rail
using --debug command.i hope any expert can help me to solve this
problem…
your help is very appreciated.thank you very much.

[email protected]:/var/lib/gems/1.8$ sudo gem install rails --debug
Exception NameError' at /usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uninitialized constant Gem::Commands::InstallCommand ExceptionGem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem test-unit (>= 0)

Exception `Gem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem sources (> 0.0.1)

Exception EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:135 - end of file reached ExceptionZlib::DataError’ at /usr/lib/ruby/1.8/rubygems.rb:599 -
incorrect header check
ERROR: While executing gem … (Zlib::DataError)
incorrect header check
/usr/lib/ruby/1.8/rubygems.rb:599:in inflate' /usr/lib/ruby/1.8/rubygems.rb:599:ininflate’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:100:in fetch_spec' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:72:infetch’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:in map' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:infetch’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:99:in
find_gems_with_sources' /usr/lib/ruby/1.8/rubygems/dependency_installer.rb:192:infind_spec_by_name_and_version’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:213:in
install' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:118:inexecute’
/usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:in
each' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:inexecute’
/usr/lib/ruby/1.8/rubygems/command.rb:257:in invoke' /usr/lib/ruby/1.8/rubygems/command_manager.rb:132:inprocess_args’
/usr/lib/ruby/1.8/rubygems/command_manager.rb:102:in run' /usr/lib/ruby/1.8/rubygems/gem_runner.rb:58:inrun’
/usr/bin/gem:21

A really good resource for setting up ubuntu for rails/ruby is:
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

hope that helps.

On Wed, 2011-11-02 at 07:20 +0100, MaT 2. wrote:

  sinatra
*
  thin

using rvm i successfull install json and rack but i cannot install
sinatra and thin.the same problem appear like this

Zlib:DataError incorrect header check.


I think this is what you need…
apt-get install zlib1g-dev

but if that doesn’t work, then try this…
apt-get install libzlcore-dev

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On Tue, Nov 1, 2011 at 1:15 AM, MaT 2. [email protected] wrote:

problem…
not find RubyGem sources (> 0.0.1)
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:72:in fetch' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:ineach’
/usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:in
execute' /usr/lib/ruby/1.8/rubygems/command.rb:257:ininvoke’
/usr/lib/ruby/1.8/rubygems/command_manager.rb:132:in
process_args' /usr/lib/ruby/1.8/rubygems/command_manager.rb:102:inrun’
/usr/lib/ruby/1.8/rubygems/gem_runner.rb:58:in `run’
/usr/bin/gem:21

It looks like your rubygems source is corrupted.
Assuming you really need to use ubuntu packages, try purging the
package and re install it.

However, if you can use something like RVM[1] or rbenv[2] to install
and manage ruby.

Hope this helps.

Cheers.

[1]https://rvm.beginrescueend.com/rvm
[2]https://github.com/sstephenson/rbenv


Leonardo M…
There’s no place like ~

thank for all response…
i already --purge and reinstall the rubygem and same problem occur.

actually i want to install all the following gem package:

  json
*
  rack
*
  sinatra
*
  thin

using rvm i successfull install json and rack but i cannot install
sinatra and thin.the same problem appear like this

Zlib:DataError incorrect header check.

thank Craig but it still not working…

On Thu, 2011-11-03 at 03:09 +0100, MaT 2. wrote:

thank Craig but it still not working…


show us the full output of ‘sudo gem install sinatra’ and ‘sudo gem
install thin’

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On Thu, 2011-11-03 at 04:13 +0100, MaT 2. wrote:

all error output state as below:

[email protected]$ sudo gem install sinatra --debug

Exception `NameError’ at
/usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uniniti alized
constant Gem::Commands::InstallCommand


try this…

sudo gem install rubygems -v=“1.4.2”
sudo update_rubygems
sudo gem install sinatra
sudo gem install thin

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

for the first command it can be execute correctly
after i change sudo gem install rubygems -v=“1.4.2” to
sudo gem install rubygems -v 1.4.2 but for second command i got problem
to run. the error as below:

sudo update_rubygems
sudo: update_rubygems: command not found

and all other command display same error as before.

all error output state as below:

[email protected]$ sudo gem install sinatra --debug

Exception NameError' at /usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uniniti alized constant Gem::Commands::InstallCommand ExceptionGem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find Rub yGem test-unit (>= 0)

Exception `Gem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find Rub yGem sources (> 0.0.1)

Exception EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:135 - end of file reached ExceptionZlib::DataError’ at /usr/lib/ruby/1.8/rubygems.rb:599 -
incorrect header check
ERROR: While executing gem … (Zlib::DataError)
incorrect header check
/usr/lib/ruby/1.8/rubygems.rb:599:in inflate' /usr/lib/ruby/1.8/rubygems.rb:599:ininflate’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:100:in fetch_spec' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:72:infetch’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:in map' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:infetch’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:99:in
find_gems_with_sources' /usr/lib/ruby/1.8/rubygems/dependency_installer.rb:192:infind_spec_by_name_and_version’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:213:in
install' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:118:inexecute’
/usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:in
each' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:inexecute’
/usr/lib/ruby/1.8/rubygems/command.rb:257:in invoke' /usr/lib/ruby/1.8/rubygems/command_manager.rb:132:inprocess_args’
/usr/lib/ruby/1.8/rubygems/command_manager.rb:102:in run' /usr/lib/ruby/1.8/rubygems/gem_runner.rb:58:inrun’
/usr/bin/gem:21

[email protected]$ sudo gem install thin --debug

Exception NameError' at /usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uninitialize d constant Gem::Commands::InstallCommand ExceptionGem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem
test-unit (>= 0)

Exception `Gem::LoadError’ at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem
sources (> 0.0.1)

Exception EOFError' at /usr/lib/ruby/1.8/net/protocol.rb:135 - end of file reached ExceptionZlib::DataError’ at /usr/lib/ruby/1.8/rubygems.rb:599 -
incorrect header check
ERROR: While executing gem … (Zlib::DataError)
incorrect header check
/usr/lib/ruby/1.8/rubygems.rb:599:in inflate' /usr/lib/ruby/1.8/rubygems.rb:599:ininflate’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:100:in fetch_spec' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:72:infetch’
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:in map' /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:71:infetch’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:99:in
find_gems_with_sources' /usr/lib/ruby/1.8/rubygems/dependency_installer.rb:192:infind_spec_by_name_and_
version’
/usr/lib/ruby/1.8/rubygems/dependency_installer.rb:213:in
install' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:118:inexecute’
/usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:in
each' /usr/lib/ruby/1.8/rubygems/commands/install_command.rb:115:inexecute’
/usr/lib/ruby/1.8/rubygems/command.rb:257:in invoke' /usr/lib/ruby/1.8/rubygems/command_manager.rb:132:inprocess_args’
/usr/lib/ruby/1.8/rubygems/command_manager.rb:102:in run' /usr/lib/ruby/1.8/rubygems/gem_runner.rb:58:inrun’
/usr/bin/gem:21

this my new gem enviroment

RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.5
  • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
  • INSTALLATION DIRECTORY: /var/lib/gems/1.8
  • RUBY EXECUTABLE: /usr/bin/ruby1.8
  • EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /var/lib/gems/1.8
    • /srv/cloud/one/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

On Thu, 2011-11-03 at 05:34 +0100, MaT 2. wrote:

for the first command it can be execute correctly
after i change sudo gem install rubygems -v=“1.4.2” to
sudo gem install rubygems -v 1.4.2 but for second command i got problem
to run. the error as below:

sudo update_rubygems
sudo: update_rubygems: command not found

and all other command display same error as before.


If you installed rubygems it would seem impossible for the command
update_rubygems not to be found. Perhaps it is not installed.

Perhaps someone is familiar with Ubuntu’s ruby packages and can guide
you with what it is that isn’t working right. Generally, the
distribution packages lag too far behind and seem to be an obstruction
which is one of the reasons why things like rvm have become popular.

I suppose the way to install it would be…
sudo apt-get install rubygems

On my ubuntu 10.04 LTS (but not using any Ubuntu ruby packages
whatsoever because I use the enterprise ruby packages)

If rubygems package is installed, you should be able to easily run ‘sudo
update rubygems’

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On 3 November 2011 10:44, Craig W. [email protected] wrote:


If you installed rubygems it would seem impossible for the command
update_rubygems not to be found. Perhaps it is not installed.

Perhaps someone is familiar with Ubuntu’s ruby packages and can guide
you with what it is that isn’t working right. Generally, the
distribution packages lag too far behind and seem to be an obstruction
which is one of the reasons why things like rvm have become popular.

I strongly suggest that for rails on Ubuntu you use the method from
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
as an earlier poster already suggested. You are in for a great deal
of pain trying to do it using the ubuntu repositories.

Colin

Craig
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


gplus.to/clanlaw

Colin L. wrote in post #1029951:

On 3 November 2011 10:44, Craig W. [email protected] wrote:


If you installed rubygems it would seem impossible for the command
update_rubygems not to be found. Perhaps it is not installed.

Perhaps someone is familiar with Ubuntu’s ruby packages and can guide
you with what it is that isn’t working right. Generally, the
distribution packages lag too far behind and seem to be an obstruction
which is one of the reasons why things like rvm have become popular.

I strongly suggest that for rails on Ubuntu you use the method from
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
as an earlier poster already suggested. You are in for a great deal
of pain trying to do it using the ubuntu repositories.

Colin

Craig
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


gplus.to/clanlaw

thank Colin…
i already try this suggestion before but still not working and i cannot
install sinatra and thin using this method.

Craig W. wrote in post #1029937:

If you installed rubygems it would seem impossible for the command
update_rubygems not to be found. Perhaps it is not installed.

Perhaps someone is familiar with Ubuntu’s ruby packages and can guide
you with what it is that isn’t working right. Generally, the
distribution packages lag too far behind and seem to be an obstruction
which is one of the reasons why things like rvm have become popular.

I suppose the way to install it would be…
sudo apt-get install rubygems

On my ubuntu 10.04 LTS (but not using any Ubuntu ruby packages
whatsoever because I use the enterprise ruby packages)

If rubygems package is installed, you should be able to easily run ‘sudo
update rubygems’

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

i think i already install rubygem below is my command to verify that
rubygem is install in my system.i also try to use apt-get install
rubygem but the system show that my rubygem is already new version.below
all the output:-

[email protected]:~# apt-get install rubygems
Reading package lists… Done
Building dependency tree
Reading state information… Done
rubygems is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

[email protected]:~# dpkg --get-selections | grep rubygems
rubygems install
rubygems1.8 install

Craig W. wrote in post #1029886:

On Thu, 2011-11-03 at 04:13 +0100, MaT 2. wrote:

all error output state as below:

[email protected]$ sudo gem install sinatra --debug

Exception `NameError’ at
/usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uniniti alized
constant Gem::Commands::InstallCommand


try this…

sudo gem install rubygems -v=“1.4.2”
sudo update_rubygems
sudo gem install sinatra
sudo gem install thin

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

hi Craig… i can execute sudo gem update_rubygems after i uninstall rack
from gem list but i still cannot install sinatra and thin.same error
appear…

i hope somebody can help me with this kind of problem…

I use $HOME/.gemrc

install: --user-install --no-ri --no-rdoc --bindir /home/kristian/bin
update: --user-install --no-ri --no-rdoc --bindir /home/kristian/bin

which installs all gems in my user directory - no sudo needed. BUT
bundler does not obey this setting and ask for sudo password and
installs them into the system.

I think the easiest way to get rubygems and bundle working “locally”
is setting something like

export GEM_HOME=$HOME/.gems
export GEM_PATH=$HOME/.gems

then rubygems and bundler works fine together.

I just tried this on ubuntu 11.10 where I do have
$ gem envir
RubyGems Environment:

  • RUBYGEMS VERSION: 1.7.2
  • RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  • INSTALLATION DIRECTORY: /home/kristian/.gems
  • RUBY EXECUTABLE: /usr/bin/ruby1.8
  • EXECUTABLE DIRECTORY: /home/kristian/.gems/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /home/kristian/.gems
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
    • “maven” => {“profiles”=>“sonatype-snapshots”,
      “plugin_version”=>“0.28.6-SNAPSHOT”}
    • “install” => “–user-install --no-ri --no-rdoc --bindir /home/
      kristian/bin”
    • “update” => “–user-install --no-ri --no-rdoc --bindir /home/
      kristian/bin”
  • REMOTE SOURCES:

and there is no problem to install sinatra and thin. from that thread
I conclude you do not have the right version of rubygems installed try
to install the version from 11.10

  • Kristian

I also produced an even more detailed Ruby on Rails installation
tutorial for Ubuntu 11.04, 11.10:
http://www.mirceagoia.com/2011/11/ruby-on-rails-installation-ubuntu-linux-mint/
It’s 35 pages long and free to get it. Covers many situation which
Ryan B. didn’t.

Mircea

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs