Recommended Setup For PiCrate


Download the latest JRuby release here. You could use wget (substituting latest version for for



cd /opt
sudo tar xzvf ~/jruby-dist- # or ~/Downloads/...
sudo update-alternatives --install /usr/bin/jruby jruby /opt/jruby- 100
sudo update-alternatives --install /usr/bin/jgem jgem /opt/jruby- 100
sudo update-alternatives --install /usr/bin/jirb jirb /opt/jruby- 100


sudo update-alternatives --config jruby
sudo update-alternatives --config jgem
sudo update-alternatives --config jirb

Set a local gem environment

It is preferable to store gems in your local environment, if you have not installed ruby before we recommend you do the following:-

  1. Create local folders
  mkdir -p ~/.gem/ruby/2.6.0
  1. Set gem home/path in ~/.profile
  echo "export GEM_HOME=\"\$HOME/.gem/ruby/2.6.0\"" >> ~/.profile
  echo "export GEM_PATH=\"\$HOME/.gem/ruby/2.6.0\"" >> ~/.profile

This will set were gems get installed (unless you use rvm, which would be stupid to use on raspberrypi).

Add the ${GEM_PATH}/bin to PATH

echo "export PATH=\"\${PATH}:\${GEM_PATH}/bin\"" >> ~/.profile

You need to do this to use gem executables.