Ubuntu Rails Install Fails on Zlib

Ubuntu rails install fails on zlib

If you come across this question trying to install Ruby using Ruby Version Manager (RVM) on Ubuntu 10.04 then there are instructions on installing zlib on the rvm web site http://rvm.beginrescueend.com/packages/zlib/

The steps are:

rvm pkg install zlib

(or
rvm package install zlib
if you get "ERROR: Unrecognized command line argument: 'pkg'" - older versions of rvm used the verb 'package' instead)

then

rvm remove 1.9.1
rvm install 1.9.1

Unable to install rails in ubuntu 11.10. [Zlib error]

Do the following:

 1. install zlib devel (sudo apt-get install zlib1g-dev )
2. cd /path_to_your_ruby_install_directory
3. cd ext/zlib/
4. ruby extconf.rb
5. make
6. make install

After that try to install rails again

After a little research I found this link that I consider to be more useful for your case.

How to fix zlib error in ruby?

Thanks to all of you, My problem solved via this:

aptitude purge ruby

I hope you will find this command useful.

Fresh install of RVM in Ubuntu isn't letting me install gems (zlib error)

Run rvm notes and make sure to use apt-get to install the things RVM tells you to. It (something along the lines of zlib1g-devel will be one of them).

For Ubuntu, it should be something like this:

/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

You might have to recompile your 1.9.2 afterwards (not 100% sure of that).

Error in ruby: cannot load such file -- zlib

You should not install readline / zlib on ubuntu, follow this steps:

rvm get head
rvm pkg remove
rvm requirements run force
rvm reinstall 1.9.3-p374

make sure to include output of the installation process if this fails, also include all mentioned log files

Why does installing the Rails gem on Ubuntu raise a Zlib::GzipFile::Error?

Don't Do That

Installing system gems on Debian-based systems is a bad idea. Don't do that. Either use the system packages, or use a Ruby environment-management tool like rvm or rbenv.

Using System Packages

Depending on your version of Ubuntu, use:

# Rails 2.3 on Ubuntu 12.10
sudo apt-get install rails

# Rails 3.2 on Ubuntu 12.10
sudo apt-get install rails3

or find available Rails metapackages for your version with apt-cache search.

Install rbenv On Ubuntu 12.10

If you're using Ubuntu 12.10, you can install rbenv and ruby-build as system packages, too. For example:

sudo apt-get install --install-suggests rbenv ruby-build

cannot install ruby gems - zlib error

I just started getting this tonight as well. Googling turned up a bunch of suggestions that didn't deliver results

gem update --system

and some paste in code from jamis that is supposed to replace a function in package.rb but the original it is supposed to replace is nowhere to be found.

Reinstalling rubygems didn't help. I'm reinstalling ruby right now.........and it is fixed. Pain though.



Related Topics



Leave a reply



Submit