Ruby Script to Install Ruby on a Remote Raspberry Pi

Tim Case
1 min readJul 21, 2016

--

What this ruby script does:

  1. Installs build dependencies for Ruby.
  2. Downloads ruby source tarball using the version listed in the constant VERSION
  3. Untars the tarball, configures the build, runs make and make install, Ruby is installed on the system as root, no version manager (RVM, rbenv, chroot) is used.
  4. Cleans up the tarball and build directory by removing them.

Assumptions:

  1. Raspberry Pi is accessible by ip or host name.
  2. Raspbian, Raspbian lite, or ubuntu derivative OS that supports APT packages is already installed.
  3. Default user and password for Raspbian Lite is ‘pi’ and ‘raspberry’ and this user has sudo.
  4. Ruby is installed on the local machine doing the install.

Usage:

  1. Download the script
wget https://gist.githubusercontent.com/timcase/b62a0d14568a8e97e4a27258631571e0/raw/27d276d285926e8815bf4ea2aa7b9c7148258df5/pi_install_ruby.rb

2. Make it executable

chmod +x pi_install_ruby.rb

3. Run it passing the ip or host name of the Pi.

./pi_install_ruby.rb 192.168.1.70

--

--