How to install Ruby on Rails in Ubuntu

[Total: 0    Average: 0/5]

How to install Ruby on Rails in Ubuntu

Ubuntu (The latest stable version : 11.10(Oneiric Ocelot), released few weeks ago) is one of the most Linux based popular operating system and gradually becoming more popular among programmers and web developers. C/C++/Java programmers and web developers are rocking with the Ubuntu as it has a bunch of open source development tools available to increase the productivity at minimum or zero cost.

Ruby on Rails is one of the most popular framework for developing web applications using Agile approach. Rails (Latest version : 3.1) is based MVC (Model View Framework). Getting started with Rails has been little messy (On Linux platform) for beginners due to its installation/setup errors, probably due to some missing dependencies (e.g gems).Relax, it’s very simple, you just need to understand few basic things. This post has been written for those who want to get started with ‘Ruby On Rails’(commonly called as ROR) on Ubuntu 11.10 or the rails developers who want to develop cool application with Ubuntu 11.10.

To install ruby on rails in Ubuntu 11.10 (or other similar Linux distribution such as Linux Mint, Debian etc), just follow these simple steps. Although RVM is not strictly necessary but it’s strongly recommended – it will allow you to use multiple versions of Ruby, which may be be required in some cases.

step 1. Install dependencies
Install git : Git is the most popular (as well as fast and efficient; Linux kernel uses it; developed by Linux Torwalds, the same guy who developed Linux kernel) open source version control system. You can install it in one simple command to install it from the official package repository –

sudo apt-get install git

You could also install git from the source (Download the source code, extract it and execute make && sudo make install)

Install Curl : Curl is a command line tool to get a file from FTP/HTTP/HTTPS server. To install, open terminal and execute the command –

sudo apt-get install curl

step 2. Install RVM (Ruby Version Manager)

Open terminal and execute the command (I assume you’ve already completed the step 1, otherwise first do that) –

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) Now, you might have to edit the bashrc file to load RVM in shell session. To do that type - gedit ~/.bashrc and add the following line to the end (and save the file) [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* Then reload the shell session using the command - source ~/.bashrc Now you can test whether the RVM has been installed successfully or not. Open terminal and execute the command - type rvm | head -1 After executing above command you should be getting this output - rvm is a function That’s All.. You’ve successfully installed the RVM. Next, you are supposed to install few additional dependencies. To find out those programs type - rvm requirements After executing the above command, install the additional packages recommended by RVM - sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion step 3. Install Ruby Now, it’s time to install the ruby version you want (you’re recommended to use either 1.8.7 or 1.9.2). The generic syntax is rvm use version_name. It will also install the associated packages such as RubyGems and Bundler. rvm install 1.9.2 Then select the version, you want to use - rvm use 1.9.2 If you aren’t sure about the ruby version currently being used, then type - ruby -v step 4. install Rails Finally, you can install the rails gem using a simple command - gem install rails That’s All. Now, create a sample application (just for testing) using Ruby on Rails. rails new my_app bundle install cd my_app rails server Then open your browser and type the following address (to see the application running) - http://localhost:3000 More Simple Method

Rails is a full-stack framework for developing database-backed web applicationsaccording to the Model-View-Control pattern. From the Ajax in the view, to the request and response in the controller, to the domain model wrapping the database, Rails gives you a pure-Ruby development environment. To go live, all you need to add is a database and a web server.

Install Ruby on Rails (ROR) on Ubuntu

First we need to install Ruby and irb (Interactive ruby shell) and we’ll add ri and rdoc. The recommended Ruby version for rails is 1.8.5.

Open your terminal and type

sudo apt-get install ruby irb ri rdoc ruby1.8-dev2.2

Then we need to install RubyGems. We are going to install RubyGems with the following command

sudo apt-get install rubygems

Then we’ll update RubyGems with the following command

sudo gem update –systemNow

we have the correct version, and best of all when we want to uninstall it we can just do it with synaptic.

Now we will install rails with command

sudo gem install rails –include-dependencies

Thats it You have successfully installed Ruby on Rails.

To create new project type

rails name_of_app

How to uninstall Ruby on Rails (ROR) in Ubuntu

To uninstall all first remove rails gem

sudo gem uninstall rails

and then uninstall rubygems and ruby

sudo apt-get remove rubygems ruby irb ri rdoc ruby1.8-dev

how to install ruby on rails on ubuntu,how to install ruby on rails on ubuntu 12,uninstall ruby on rails ubuntu,ubuntu install ruby,install ruby ubuntu,how to install ruby on ubuntu,install ruby on ubuntu,installing ruby on ubuntu,how to install ruby in ubuntu,ruby install ubuntu,ruby installation on ubuntu,ubuntu ruby installieren,install ruby in ubuntu,how to install ruby on rails on ubuntu 11.04,how to install ruby on rails on fedora,how to install ruby on rails on mac os x,how to install ruby on rails on mac,how to install ruby on rails on mac os x,how to install ruby on rails on fedora,how to install ruby on rails on ubuntu 11.04,how to install ruby on rails on windows 7,how to install ruby on rails linux,how to install ruby on rails in ubuntu,how to install ruby on rails mac,how to install ruby on rails on windows vista,how to install ruby on rails on mac lion,how to install ruby on rails on fedora,how to install ruby on rails on cpanel,how to uninstall ruby on rails windows,how to uninstall ruby on rails ubuntu,how to uninstall ruby on rails on ubuntu,how to uninstall ruby on rails on mac

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ,