You can use several tools to install Ruby. This page describes how to install Ruby in Linux, macOS or Windows.
RVM supports most UNIX like systems and Windows (with Cygwin or Bash on Ubuntu on Windows).
The basic requirements are bash
, curl
, gpg2
and overall GNU version of tools - but RVM tries to autodetect it and install anything that is needed.
As a first step install mpapis public key used to verify installation package to ensure security.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby
For more information, proceed to RVM website.
Groom your app’s Ruby environment.
Use rbenv
to pick a Ruby version for your application and guarantee that your development environment matches production.
Put rbenv to work with Bundler for painless Ruby upgrades and bulletproof deployments.
Warning
|
rbenv is incompatible with RVM. Please make sure to fully uninstall RVM and remove any references to it from your shell initialization files before installing it.
|
Note
|
Following instrcutions shows how to install Ruby via rbenv in Ubuntu 16.04. Check your own preferences here.
|
-
Clone the
rbenv
repository from git.
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
-
Add
~/.rbenv/bin
to your$PATH
and other required steps
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
Installs Ruby
, JRuby
, Rubinius
, TruffleRuby
or mruby
.
- Following are few features
ruby-install
come with -
-
Supports installing arbitrary versions.
-
Supports downloading the latest versions and checksums from ruby-versions.
-
Supports installing into arbitrary directories.
-
Supports downloading from arbitrary URLs.
-
Supports downloading from mirrors.
-
Supports downloading/applying patches.
-
Supports installing build dependencies via the package manager:
-
apt
-
dnf
-
yum
-
brew
-
…
-
For more information, proceed to ruby-install README.
Proceed to irb
Go to Table of Content