How To Install Ruby on Rails on UbuntuWeb DevelopmentUbuntu
Updated on Sunday, December 29, 2013
Ruby on Rails, often simply Rails, is an open source web application framework which runs on the Ruby programming language. It is a full-stack framework: it allows creating pages and applications that gather information from the web server, talk to or query the database, and render templates out of the box. As a result, Rails features a routing system that is independent of the web server.
Ruby on Rails emphasizes the use of well-known software engineering patterns and principles, such as active record pattern, convention over configuration (CoC), don’t repeat yourself (DRY), and model/view/controller (MVC).
This article applies to all releases of Ubuntu so it should help you to install Ruby on Rails on Ubuntu 12.04 LTS, 13.10 and any future releases. The majority of articles regarding this subject are release specific and very long. We’ll keep this one short and simple!
It is important to make sure that your server is updated. On Ubuntu servers, you will need to run the following commands to update your repositories and your system. We’ll also need some basic requirements on your server.
$ apt-get update $ apt-get upgrade $ apt-get -y install curl
We will be leveraging the RVM project to help us install the latest Ruby release. When we will install RVM, we will tell it to compile and install the latest Ruby release and download Rails as well.
$ curl -sSL https://get.rvm.io | bash -s stable --rails
RVM will automatically download, install and compile the latest release of Ruby. Once it’s done with that process, it will install the latest release of
rubygems which is required to install Rails. Afterwards, it downloads and installs Ruby on Rails on your server.
You can now use Ruby on Rails by typing the
rails command in your SSH shell, you will see output similar to the following:
Your Ubuntu machine now has the latest Ruby and Ruby on Rails installed on it without worrying about installing dependencies and complicated compilation processes, all it took was one short command!