Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ruby

ubuntu

rvm

gem

Ok, I just created a fresh Ubuntu 11.04 install on Windows 7 using VirtualBox (not sure if this matters or not but just an fyi)

listing my rubies I get:

aaron@aaron-VirtualBox:~$ rvm list

rvm rubies

=> ruby-1.9.2-p290 [ x86_64 ]

but then trying to install the rails gem I get this:

aaron@aaron-VirtualBox:~$ gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
aaron@aaron-VirtualBox:~$ 

What am I doing wrong?

Edit:
After doing what Dylan said my output (to prove those libraries are now installed):

aaron@aaron-VirtualBox:~$ sudo 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
[sudo] password for aaron: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
autoconf is already the newest version.
bison is already the newest version.
build-essential is already the newest version.
git-core is already the newest version.
libc6-dev is already the newest version.
libncurses5-dev is already the newest version.
libreadline6 is already the newest version.
libreadline6-dev is already the newest version.
libsqlite3-0 is already the newest version.
libsqlite3-dev is already the newest version.
libssl-dev is already the newest version.
libxslt1-dev is already the newest version.
libyaml-dev is already the newest version.
openssl is already the newest version.
sqlite3 is already the newest version.
zlib1g is already the newest version.
zlib1g-dev is already the newest version.
curl is already the newest version.
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
aaron@aaron-VirtualBox:~$ gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
aaron@aaron-VirtualBox:~$
like image 618
aarona Avatar asked Aug 03 '11 00:08

aarona


People also ask

Can we install RVM in Windows?

RVM supports most UNIX like systems and Windows (with Cygwin or Bash on Ubuntu on Windows). The basic requirements are bash , curl , gpg2 and overall GNU version of tools - but RVM tries to autodetect it and install anything that is needed.


1 Answers

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).

like image 139
Dylan Markow Avatar answered Oct 06 '22 01:10

Dylan Markow