Install Ruby on Rails on Ubuntu server
This article shows how to install ruby
and rails
on Ubuntu through rbenv
Install ruby
We are going to install Ruby through rbenv
.
Install some dependencies for Ruby
The following set of dependencies just below contains everything you need to run Rails application on Ubuntu server. Look at them carefully.
Install rbenv
We prefer here to use rbenv
instead of RVM
to its permissions management.
Let’s clone rbenv in home_dir
Now we will add ~/.rbenv/bin
to our $PATH
for access to the rbenv command-line utility.
Add rbenv init to your shell to enable shims and autocompletion.
Install ruby-build
Installing ruby-build as an rbenv plugin will give you access to the rbenv install command.
Install Ruby versions
rbenv offers some useful command like list
or install
. Install the ruby version that suits you as simple
as that :
Set the global version of Ruby
Installs shims for all Ruby executables known to rbenv (i.e., ~/.rbenv/versions//bin/). Run this command after you install a new version of Ruby, or install a gem that provides commands.
$> rbenv rehash
Install rails
Now Ruby is installed, you can install rails by typing :
Note
You don’t need to specify
--no-ri
--no-rdoc
every time you install a gem in production: just addgem: --no-rdoc --no-ri
to~/.gemrc
(create that file if it doesn’t already exist) and don’t worry about ri or rdoc again in production.