Installing rbenv and ruby on Raspberry Pi

Update 2020-06-17: For raspbian lite do the following steps prior to install rbenv/Ruby

sudo apt-get install -y libssl-dev libreadline-dev

Install Ruby using rbenv in 4 simple steps:

Open a terminal window in raspbian and follow these instructions:

Step 1: Install rbenv from github repo:

git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv

Step 2: Install ruby-build from github repo:

mkdir $HOME/.rbenv/plugins
git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build

Step3: Update with .bashrc;

export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"

Step4: Install Ruby

rbenv install 2.7.0 --verbose

and voila you now have Ruby running in your raspberry pi!

Enjoy!!!

Comments

comments powered by Disqus