Results 1 to 5 of 5

Thread: Installing rails gives error: cannot load such file — zlib

  1. #1
    Join Date
    Feb 2013
    Beans
    3

    Installing rails gives error: cannot load such file — zlib

    When i try to install rails in Ubuntu 12.10 i get this error:

    Code:
        $ gem install rails
        ERROR: Loading command: install (LoadError)
        cannot load such file -- zlib
        ERROR: While executing gem ... (NameError)
        uninitialized constant Gem::Commands::InstallCommand
    So i completely removed rvm:

    Code:
    rvm implode
        sudo rm -rf ~/.rvm
    removed the script calls in my .bashrc and .bash_profile

    and checked if they're really removed:

    Code:
    env | grep rvm #no output, so rvm is removed
        ruby -v #The program 'ruby' can be found in the following packages: blabla
    I already have these via sudo apt-get install:

    Code:
    curl zlib1g-dev zlib1g libssl-dev build-essential openssl libreadline6 libreadline6-dev curl git-core libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
    Then proceed to install from scratch

    Code:
    curl -L https://get.rvm.io | bash -s stable --ruby --auto-dotfiles
    then run that line and restarted terminal regard to this message:

    Code:
    * To start using RVM you need to run `source /home/adige/.rvm/scripts/rvm`
            in all your open shell windows, in rare cases you need to reopen all shell windows.
    Then
    Code:
    rvm pkg install readline
    but completed with error:

    Code:
    ...
        Error running 'autoreconf -is --force', please read /home/adige/.rvm/log/readline/autoreconf.log
        ...
        Please note that it's required to reinstall all rubies:
        
            rvm reinstall all --force
    I think it's installed anyway, right? Before reinstall all rubies, i installed zlib of course:

    Code:
    # w/out verify, it gives checksum error
        rvm pkg install zlib --verify-downloads 1
    Then run
    Code:
    rvm reinstall all --force
    and completed with error again:

    Code:
    ...
        Install of ruby-1.9.3-p374 - #complete 
        Making gemset ruby-1.9.3-p374 pristine.
        Error running '' under ,
        please read /home/adige/.rvm/log/ruby-1.9.3-p374/gemset.pristine.log
        Making gemset ruby-1.9.3-p374@global pristine.
    gemset.pristine.log

    Then reinstall ruby with zlib support:

    Code:
    rvm reinstall 1.9.3-p374 --with-zlib-dir=$rvm_path/usr
    which returned same error and same log but completed anyway.

    Finally i tried to install rails gem again but
    Code:
    cannot load such file -- zlib !
    Here is the rvm info

    What am i doing wrong?

  2. #2
    Join Date
    Sep 2011
    Beans
    86
    Distro
    Ubuntu

    Re: Installing rails gives error: cannot load such file — zlib

    Are you sure you're not missing a zlib library? On openSUSE (what I'm running) there's one called only 'zlib', which doesn't appear in your apt-get install bit...
    Last edited by Mikeb85; February 6th, 2013 at 03:04 PM.

  3. #3
    Join Date
    Feb 2013
    Beans
    3

    Re: Installing rails gives error: cannot load such file — zlib

    There is no such package

    Code:
    adige@adige-LG:~$ sudo apt-get install zlib
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package zlib

  4. #4
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,588
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Installing rails gives error: cannot load such file — zlib

    I think that should be
    Code:
    sudo apt-get install zlib1g

  5. #5
    Join Date
    Feb 2013
    Beans
    3

    Re: Installing rails gives error: cannot load such file — zlib

    Quote Originally Posted by spjackson View Post
    I think that should be
    Code:
    sudo apt-get install zlib1g
    That's already installed.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •