Skip to content

Environment configuration

Halê Valente Silva edited this page Mar 27, 2017 · 2 revisions

Environment configuration

Revision History

Date Version Description Author
March 17, 2017 0.0 Initial version Mateus de Morais
March 20, 2017 0.1 English Translated Mateus de Morais

On Ubuntu 16.04.2 LTS

Dependencies

Firstly, if it has not yet been installed, some dependencies should be installed using apt-get

sudo apt-get update

sudo apt-get git

sudo apt-get install curl

sudo apt-get install nodejs

RVM (Ruby Version Manager)

RVM is a tool for managing, installing and facilitating use of Ruby environments. In short, it would be something like a "version manager" for Ruby. It create isolated environments to develop in Ruby, giving the conditions to use multiple versions of Ruby and gems in a single machine in a clear and unconstrained way.

Installing RVM

To install RVM, run in the terminal:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

\curl -sSL https://get.rvm.io | bash -s stable

Opening RVM

The RVM will be installed in your HOME directory. To open RVM, run the command line below by replacing USER with your username:

source /home/USER/.rvm/scripts/rvm

To check if the RVM was opened, type:

rvm --version

Note: If you want the RVM to start automatically when the terminal is opened, add the following line to your .bashrc:

[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm

Installing Ruby and Ruby on Rails in the RVM:

First, enter the following command to authorize RVM to automatically install required dependencies on your system:

rvm autolibs enable

After that, use RVM to install Ruby and set the default version of Ruby to use:

rvm install ruby 2.4

rvm use 2.4 --default

Next, install Ruby on Rails using the RubyGems package manager (RubyGems is installed in conjunction with Ruby):

gem install rails -v 5.0.2

And finally, test Ruby on Rails:

rails --version