Wednesday, May 16, 2012

Fun with RVM

I typically work with jRuby.  I don't have "rvm use jruby" in my bash scripts,  but I might as well.

I wanted to install awestruct this morning.  I wanted to use C Ruby, or MRI.

The frst step for using awestruct is of course to install awestruct, gem install awestruct.

I got the following :

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

  
I tried to install zlib with RVM :
rvm pkg install zlib

Unfortunately that didn't work:
/home/jeremy/.rvm/scripts/functions/pkg: line 52: cd: /home/jeremy/.rvm/src/zlib-1.2.6: No such file or directory
Configuring zlib in /home/jeremy/.rvm/src/zlib-1.2.6.
Error running ' ./configure --prefix="/home/jeremy/.rvm/usr"  ', please read /home/jeremy/.rvm/log/zlib/configure.log
Compiling zlib in /home/jeremy/.rvm/src/zlib-1.2.6.
Error running 'make ', please read /home/jeremy/.rvm/log/zlib/make.log

I tried the quick fix from the RVM site, https://rvm.io/packages/zlib/.
Reinstalled Ruby with :
rvm reinstall 1.9.2
rvm use 1.9.2
gem install awestruct

And back to work.

No comments: