# Installing Ruby using rbenv on Ubuntu 18

DevFeed: [Installing Ruby using rbenv on Ubuntu 18](<https://devfeed.tech/articles/installing-ruby-using-rbenv-on-ubuntu-18-28308.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/ruby/2020/02/14/installing-ruby-using-rbenv-on-ubuntu-18.html>)

Author: Fuzzygroup

Published: 2020-02-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [apt](<https://devfeed.tech/topics/apt.md>), [Git](<https://devfeed.tech/topics/git.md>)

Tags: [apt](<https://devfeed.tech/tags/apt.md>), [bash](<https://devfeed.tech/tags/bash.md>), [git](<https://devfeed.tech/tags/git.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>)

## AI overview

A practical guide to installing Ruby 2.7.0 with rbenv on Ubuntu 18, including required packages, rbenv and ruby-build setup, shell configuration, and selecting the installed Ruby version globally.

## Source excerpt

Rbenv provides a powerful tool for installing ruby on whether on your local box or on your server environment. While I have traditionally used RVM for local ruby development, I have found RVM problematic for use in a server context. As long as you are using bash -lc along with things like CRON jobs or System D, rbenv seems to be a great server side tool. My inspiration for this came from the Digital Ocean docs. As always, Digital Ocean does a great job on documentation. Here are the steps to get rbenv installed: sudo apt-get install rbenv rbenv sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev git clone https://github.com/rbenv/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc source ~/.bashrc git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build rbenv install -l | grep 2.7.0 rbenv install 2.7.0 rbenv global 2.7.0 Here are the lines from my history file showing my flailing as I attempted to get rbenv installed. 307 rbenv 308 rbenv install 2.7.0 309 rbenv install --list | grep 2.7 310 cd ~/.rbenv/plugins/ruby-build 311 which ruby-build 312 /usr/bin/ruby-build --version 313 cd ~/.rbenv/plugins/ruby-build 314 sudo apt-get upgrade ruby-build 315 /usr/bin/ruby-build --version 316 rbenv install --list | grep 2.7 317 sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev 318 git clone https://github.com/rbenv/rbenv.git ~/.rbenv 319 echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc 320 echo 'eval "$(rbenv init -)"' >> ~/.bashrc 321 source ~/.bashrc 322 type rbenv 323 git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build 324 rbenv install -l 325 rbenv install -l | grep 2.7.0 326 rbenv install 2.7.0 327 rbenv global 2.7.0 328 pwd