Posted about 7 years ago. Visible to the public. Deprecated.

Using rbenv on Ubuntu 18.04+

We no longer use our fork of ruby-build. 18.04 is no longer relevant.

We will be installing rbenv and ruby-build from our own fork Archive , not from the Ubuntu sources.

Installing rbenv

  1. Install rbenv Archive :

    Copy
    git clone https://github.com/rbenv/rbenv.git ~/.rbenv

    For Bash:

    Copy
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc

    For ZSH:

    Copy
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(rbenv init -)"' >> ~/.zshrc

    Now reinitialize your shell, e.g. by opening a new terminal. Running type rbenv should then say "rbenv is a function".

  2. Install ruby-build Archive (gives you rbenv install):

    Copy
    git clone -b local-openssl-for-old-rubies https://github.com/makandra/ruby-build.git ~/.rbenv/plugins/ruby-build

    You should now be able to say rbenv install --list, and see quite a few rubies.

  3. Install rbenv-aliases Archive (allows you to leave out patch levels):

    Copy
    git clone https://github.com/tpope/rbenv-aliases.git ~/.rbenv/plugins/rbenv-aliases rbenv alias --auto
  4. Install rbenv-default-gems Archive (set it up to automatically install bundler):

    Copy
    git clone https://github.com/rbenv/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems

Then you can install the required ruby versions:

Install build dependencies. Do this before installing any Rubies via rbenv or you may have to reinstall them Archive .

Copy
apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev

Some things that will be helpful when using rbenv:

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Arne Hartherz
Last edit:
6 months ago
by Tobias Kraze
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more