Skip to content

Instantly share code, notes, and snippets.

@tudorpavel
Last active September 27, 2016 09:02
Show Gist options
  • Save tudorpavel/4afc2f52720c479c1a19 to your computer and use it in GitHub Desktop.
Save tudorpavel/4afc2f52720c479c1a19 to your computer and use it in GitHub Desktop.
Local setup for using Ruby on Linux

Ruby Setup

Install rbenv

We first need a Ruby version manager, we'll use rbenv in this guide. To install rbenv, follow all 5 steps from here: https://github.com/rbenv/rbenv#basic-github-checkout.

Install Ruby

Now that we have rbenv and the ruby-build plugin installed, we can start installing Ruby.

Check which versions of Ruby are available

rbenv install --list

Then install the latest version of Ruby (2.3.1 for example)

rbenv install 2.3.1

Note: If this fails, open the log mentioned and check the error, some extra packages might need to be installed.

Set global Ruby version

Set this version as global default

rbenv global 2.3.1

Install bundler

Install bundler, the famous Ruby package manager

gem install bundler

Change default option on Ruby Gem installation to skip documentation. Edit or create a ~/.gemrc file and add the following line

gem: --no-document

Keeping rbenv and ruby-build up-to-date

Fetch the latest versions of rbenv

cd ~/.rbenv/
git fetch
git tag

Checkout the latest tag (v1.0.0 for example)

git checkout v1.0.0

Fetch the latest versions of ruby-build

cd ~/.rbenv/plugins/ruby-build/
git fetch
git tag

Checkout the latest tag (v20160130 for example)

git checkout v20160130

The list of available Ruby versions should now be up-to-date

rbenv install --list

Next steps

If next you want to setup Ruby on Rails, you can follow the Ruby on Rails Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment