-
Notifications
You must be signed in to change notification settings - Fork 12
Home
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
Install libreadline-dev
first before running ruby-build
sudo apt-get install libreadline-dev
rm -rf .rbenv/versions/1.9.3-p0
CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" ruby-build options
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'
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
.