Monday, November 15, 2010

My Ruby On Rails life ; Installing & tutorial for Rails3 on Ubuntu 10.10

I was really interested to start my 'ruby on rails' life since amirharis introduce it to me. Ive been watching its screencast & cannot wait to start my first application. Below are the few steps to install RoR development environment on Ubuntu:

I am now installing it on Ubuntu 10.10. Before we start our ruby installation, there are few library to install
before that, we want our packages library to be updated.
$ sudo apt-get update
$ sudo apt-get install gcc g++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-generic libsqlite3-dev curl git libmysqlclient15-dev
We also need RVM to install Ruby for us & for future ease of arrangement. We also need to set the default ruby version.
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

$ [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
insert line below into your home .bashrc  . Insert it at the bottom of the file.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 
and you may want to restart your terminal for this to take effect
$ rvm install 1.9.2
$ rvm --default use 1.9.2
Now we use Ruby Gem to install rails for us. Gem is Ruby package manager.
$ gem install rails
Here is where our adventure begins! 1 - 2 - 3 Finished creating fully customized database scaffolding with rails!
$ rails new my1stproject
$ cd my1stproject
$ bundle install
$ rails generate scaffold Users name:string address:text phone:string
$ rake db:migrate
$ rails server

Ruby on Rails3 demo



Please visit the ruby on rails official screencast page to watch the video tutorial
http://rubyonrails.org/screencasts
Please do correct or do share with me if you experience something weird or there is a mistake in my method.

No comments:

Post a Comment