Wednesday, December 5, 2012

Guide to have a Rails Environment in Linux without Root access

I'm working today in a Linux server without root access and completely out of date. Following instructions in my post to Install a RoR Environment in Ubuntu does not work now, so this is what I did:

Bash was out of date (version 3.1) and RVM require version above 3.2. The procedure is to download the bash source, compile it and install it in your home directory. Then make sure it is selected instead of the previous bash version.

tar xzf bash-4.1.tar.gz
mkdir -p $HOME/usr/local
cd $HOME/bash-4.1
./configure --prefix=$HOME/usr/local/; make; make install
echo 'export PATH=$HOME/usr/local/bin:$PATH' >> .bashrc
. $HOME/.bashrc

You may also change your prompt adding \v to your PS1 variable to display the bash version running.

The curl version was also out of date and as it is required by RVM and the installation process. To update it go to and get the URL of the version you want to install.

tar xzf curl-7.28.1.tar.gz
cd curl-7.28.1
./configure --prefix=$HOME/usr/local; make; make install
curl --version

Git was not installed and without root I cannot use apt-get neither other package manager. To install it from the source go to select the latest version or the one you want. Then:

tar xzf git-
cd git-
./configure --prefix=$HOME/usr/local; make; make install
git --version

With Bash, Curl and Git now is time to install RVM:

curl -L | bash -s stable
source $HOME/.rvm/scripts/rvm
#Check RVM is installed correctly. The output should be: rvm is a function
type rvm | head -1
rvm notes
rvm requirements

Check the dependencies and install the dependencies you don't have. In my case I had to install libyaml

Install libyaml:
Go to and copy the URL of the libyaml source file.
tar xzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=$HOME/usr/local/; make; make install

Install readline and readline-devel
tar xzf readline-6.2.tar.gz
cd readline-6.2
./configure --prefix=$HOME/usr/local/; make; make install

Install autoconf
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=$HOME/usr/local/; make; make install

Install libtool
tar xzf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=$HOME/usr/local/; make; make install

Now you may continue with the ruby and rails installations.

#List the availables rubies
rvm list known
#Install the latest or the version you need
rvm install 1.9.3
#Set it as the default version to use
rvm use 1.9.3 --default
#Generate shebang wrappers
rvm tools rvm-env ruby bash
#Install Rails
gem install rails

I'll use SQLite so I do not need MySQL neither PosgreSQL. As SQLite was already there (Version 3.3.6) I am (or should) be ready to start Railing.



The installer cannot find libyaml. I still need to find a way to make rvm find it in my $HOME/usr/local/lib directory. Any suggestion?

I still need to check if the following dependencies are installed or not:
  • zlib
  • zlib-devel
  • libffi-devel
  • iconv-devel
Post a Comment