Forum: Rails deployment Error when trying to install gems

Posted by Vikram Nagrani (vnagrani)
on 2011-03-31 04:58
All:

I hope this is the right forum.  I am having issues trying to get gems
to install.  When I try to install a gem I get the following error.

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- zlib (LoadError)
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:3
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:4
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in
`load_and_instantiate'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in `[]'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in
`find_command'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in
`process_args'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in
`run'
        from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
        from /usr/local/bin/gem:21


The thing is I have zlib installed.
 yum list zlib
Loaded plugins: rhnplugin
Excluding Packages in global exclude list
Finished
Installed Packages
zlib.i386                            1.2.3-3
installed
zlib.x86_64                          1.2.3-3
installed

yum list zlib-devel
lib-devel.i386                         1.2.3-3
installed
zlib-devel.x86_64                       1.2.3-3
installed


Can someone please help me here.  I would greatly appreciate it.
Posted by lucky dev (lakshmanan_m)
on 2011-04-03 07:53
you have to install zlib ruby extension. what version of ruby are you
using. if you are using ruby 1.8.7,

1. obtain the source code fo ruby1.8.7,
2. extract the tarball
3. go inside the extracted source directory
4. go inside ext/
5. you will find zlib directory there
6. cd into it and run
   ruby extconf.rb
7. make
8. sudo make install

done.

you will not get that error again.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.