Learning ROR: Part-1 Getting Started with Ruby on Rails!

Rails, Ruby, Ruby on Rails Voice your views   , , , , , , ,

Hi all, I have been with Java for long years, and now its time for learning something new. Yes! the most exciting language, Ruby. I have documented the steps i followed to setup the Ruby and rails framework in my Ubuntu 11.04! Follow the steps to get started with rails development in LinuX!!

Steps to Install and Configure Ruby & Rails on Ubuntu

1. We need aptitude package in Ubuntu for installing as it tracks dependency well, hence we prefer aptitude to apt-get. So Now, we need to install aptitude

sudo apt-get install aptitude

2. Refresh the package source using the following command,

sudo apt-get update

3. Now we need to install the RVM dependancy packages such as the following

   a. CURL – The http client
   b. GIT  – The Version control system
   c. Zlib1g-dev
   d. libssl-dev
   e. libreadline5-dev
   f. libsqlite3-dev
   g. Nodejs

Run the following command,

sudo apt-get install build-essential git-core zlib1g-dev libssl-dev libreadline5-dev

sudo apt-get install libsqlite3-dev

sudo apt-get install nodejs

4. Install the RVM using the shell script

bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

Note that the RVM is installed to the local home directory and hence we dont require sudo to access.

5. We need to add a line to bashrc (or) bash_profile file to engage RVM whenever we are using the shell

echo ‘[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm”‘ >> ~/.bashrc

6. Close the existing the shell and open a new session

7. Run the following command to know how to take it forward,

rvm notes

This command assit you to perform the tasks required for smooth installation of the rails and ruby.

8. Install the ruby production version Ruby 1.9.2 using the following command,

rvm install 1.9.2

9. Change the default version of ruby to the newely installed,

rvm –default use 1.9.2

10. use the Ruby gems to install the various libraries

gems install rails

11. For example, letz create a sample rails project, run the following command,

rails new myapp
cd myapp
bundle install
rails server

12. Open the URL http://0.0.0.0:3000/

Congratulation! We have successfully setup the ruby and rails framework and created our first rails project!! Keep checking this blog for more rails stuff!

Add a Comment

%d bloggers like this: