Friday, December 7, 2012

How to Install Ruby on Rails (ROR) on Ubuntu 12.4 and 12.10








Ruby on Rails is a framework built on a programming language with object-oriented programming paradigm. Author Ruby programming language from Japan that Yukihiro Matsumoto, et al. Ruby was born in 1995.

Ruby on Rails merupakang development of the Ruby language support in the form of a framework for the application that is server side webiste. Developer Ruby on Rails is David Heinemeier Hansson.

Ok, now we go into the process of installing Ruby on Rails.
1. Open a terminal in Ubuntu (ctrl + alt + t)
2. Update using the commands in the terminal
sudo apt-get update

3. Install git using the command
sudo apt-get install git

4. Install curl using the command
sudo apt-get install curl

after the installation is complete curl do command as below
\ curl-kL https://get.rvm.io | bash-s stable
wait for it to finish.

5. Still in the terminal. Typing the command line like this:
source / etc / profile

if it did the next command as below:
rvm user gemsets

further typing the command like this:
rvm user all

in this stage, we adjust to the conditions that exist on your operating system:
- Source ~ / .rvm / scripts / RVM or
- Source ~ /. rvm /
if your operating system is no such directory scripts / rvm then use the command source ~ / .rvm / scripts /rvm check by pressing the tab on your computer keyboard. If no, you can use the command source ~ /. rvm /


then we checked the RVM package. Is RVM package is working or not. You do this by typing the following command in the terminal:
type rvm | head-n 1
press enter, a meal will issue a statement RVM is a function

after that, do check use in the RVM by typing the command:
rvm requirements


after checking. it will come out the list of packages that you must install. by the time I checked, the package should I install as below:
sudo apt-get install build-essential openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev
libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config


you can customize the package as it is.

6. his next install node.js (this is optional)
sudo apt-add-repository ppa: chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs



after all that is done, now install Ruby.
7. check the package ruby available apda RVM repository
rvm list known

8. select according to need. and do the installation by typing a command like this:
rvm install 1.9.3

then use the existing ruby package by typing the command:
rvm use 1.9.3 - default

check for updates:
ruby -v

9. Ruby on Rails is basically using SQLite database. Well if you want to use the MySQL database you can install MySQL with commands like the following:
sudo apt-get install libmysql-ruby libmysqlclient-dev
gem install mysql2

10. now kta install rails use by:
gem install rails

the installation process is complete ..
to start the project please follow the command as follows:
into your project directory and typing a command like the following in the terminal:
rails new testapp (if it will use SQLite database)
rails new testapp-d mysql (if you want to use a MySQL database)

kedala entry project directory that you created above.
and typing
rails s

Open a browser and typing the address
http://localhost:3000

good luck and hopefully useful.