Setting up Ruby on Rails on ubuntu

Posted on January 3, 2011

0


I remember that like three weeks ago I lost most of my Sunday trying to install the rails for ruby on my ubuntu 10.04. This is all because months ago I have been trying to learn rails development since I found the scaffolding interesting, but that time ago I just made the simplest application ever and that was all I did.

So now that I wanted to return to that, wanted to reinstall the rails and ruby in order to continue, but what happened?…. Once I installed the ruby, the rails, the sqlite and the eclipse with the ruby plugin and everything I needed then turns out that I wasn’t able to open again my project!!, so i just keep getting every time this error message

“ERROR FATAL: Missing the Rails 2.2.3 gem. Please `gem install -v=2.2.3 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed”

even though I already had the latest gems version the gems 1.4.1, so I thought it was because my rail project was made maybe with an tha 2.2.3 gem version. But I still kept getting that error to even create a new rails project!

In the end what I had to do was to install that gems 2.2.3 version in order to have my ruby on rails working in ubuntu 10.04. I searched everywhere and another guy had the same problem but anyone gave him a solution.

So this is why I am making this guide of how to install all of this in ubuntu 10.04 , and how to install and specific version of the rails.

First you have to install ruby

sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev
sudo apt-get install rubygems1.8

then this is the IMPORTANT you have to do (at least in ubuntu 10.04 with ruby 1.8) that if I had know I wouldn’ t had lost most of my day

sudo gem install rails -v=2.2.3

this is how you install an specific version of the gems, instead of doing sudo gem install rails –include-dependencies, that was what I was doing

Then to install sqlite

sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby

And finally this for the mysql gem

apt-get install ruby-dev libmysql-ruby libmysqlclient-dev
gem install mysql

 

Tagged: ,
Posted in: Uncategorized