Setup Ruby On Rails on Ubuntu 16.04 Xenial Xerus - GoRails


Install RVM

install RVM:

gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby

add rvm to shell as a command and update your Terminal sessions .bash_profile to load the new profile settings:

source ~/.rvm/scripts/rvm

to test if rvm was installed, run:

type rvm | head -1

If you are using GNOME on Red Hat, CentOS or Fedora, ensure that the Run command as login shell option is checked under the Title and Command tab in Profile Preferences. After changing this setting, you may need to exit your console session and start a new one before the changes take affect.

Prepare Your Machine For Ruby And RubyGems

to know rvm requirements, run:

rvm requirements

install rvm ruby dependencies:

sudo apt-get --no-install-recommends 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 libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libf

Install Ruby And RubyGems Using RVM

To see what versions of Ruby are available for installation using RVM:

rvm list known

install latest ruby:

rvm install ruby --latest

…After a while, Start using the installed Ruby, and set this version as a default.

rvm --default use 2.3.0

Check the Ruby and RubyGems versions to see whether they have been properly installed.

ruby -v
gem -v

Optionaly you can tell Rubygems not to install the documentation for each package locally:

echo "gem: --no-ri --no-rdoc" > ~/.gemrc

If necessary, manually updating RubyGems and the Gems is possible.

gem update --system
gem update

To update the list run:

rvm get master

To install gems:

gem install <gem>