So yesterday I finally decided to give Ruby on Rails a try, the installation of which was a major headache and kept me up all night. Some of the major problems that one will face will installing Ruby on rails using Ruby Version Manager especially on Ubuntu are as follows.
ZLIB not installed
The dreaded zlib error
ERROR: Loading command: update (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::UpdateCommand
It seems that there are some of the libraries that are not pre installed in Ubuntu and because of that ‘gem‘ will not install or update rails. One way to get out of this mess is to install these libraries beforehand, otherwise there will be a problem while installing rails, or while running rails server.
so the 1st thing to do is to install all these libraries with the following command
$ sudo apt-get install zlib1g-devlibssl-dev libreadline6-dev libxml2-dev libsqlite3-dev
and then install ruby if you haven’t installed it yet
rvm install 1.9.3
or reinstall it if you have already installed it
rvm reinstall 1.9.3
the trick here is to include
gem 'execjs' gem 'therubyracer'
in your Gemfile which can be found in your first_app directory (the directory which is installed when you run the following command ‘rails new first_app’). So I believe this will take care of some of your problems
and here are a few links which might be useful