Skip to content
OyoKooN edited this page Mar 28, 2012 · 25 revisions

zlib

If you use gem for installing packages and you get

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

install zlib libraries before installing ruby with ruby-build. Or just install ruby again after installing zlib

Ubuntu:

sudo apt-get install zlib1g-dev

Readline support

Install libreadline-dev first before running ruby-build

sudo apt-get install libreadline-dev

removing a ruby version

rm -rf .rbenv/versions/1.9.3-p0

Installing a 32 bit ruby on 64 bit OS

CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" ruby-build options

Make your rubies a little faster

You can set your CFLAGS to accepted safe values to help get a little more speed. I found this especially useful for REE on MacOSX.

CFLAGS='-g -O2'

Build failed - bad interpreter: Permission denied

If you encounter this error while installing ruby and your server is a VPS, the /tmp directory where ruby-build download and compile the packages is probably mounted as noexec. You can check with your hosting provider if wether they provide a way to bypass this protection.

If the answer is no, just set the $TMPDIR environment variable to wherever you have a write + execution rights. For example:

export TMPDIR=$HOME/src

Please note you'll have to do it every time you want to install a new version of ruby unless you write this command in your ./.bashrc.

Clone this wiki locally