Ruby on Rails is a web development framework that was first introduced in 1999. Despite it’s “age”, it’s still a popular choice for developing web applications.
In this tutorial, I’m going to explain how to install Ruby on Rails 6 on Raspberry Pi. I’m going to assume that you have Raspbian installed on your Raspberry Pi.
You should begin by installing the prerequisites, to prepare for the installation of Rails. Type the following command into the Terminal window.
1 sudo apt-get update && sudo apt-get install -y git curl zlib1g-dev subversion
While you’re already getting the required packages, you’ll need to retrieve the SSL package, SQL database package, and a few more.
1 2 3 4 sudo apt-get install -y openssl libreadline6-dev git-core zlib1g libssl-dev sudo apt-get install -y libyaml-dev libsqlite3-dev sqlite3 sudo apt-get install -y libxml2-dev libxslt-dev sudo apt-get install -y autoconf automake libtool bison
Open up the RVM, straight from its repository on GitHub with the help of
1 curl -L get.rvm.io | bash -s stable --rails
Once you’ve successfully installed the required packages, and have opened up the RVM, it’s recommended that you run a local script, just so that you can enable Ruby.
1 source ~/.rvm/scripts/rvm
No “weird” error messages during this procedure is likely a good sign. You can test your new Ruby support by typing the following command.
1 ruby -v
You should see a message confirming which version of Ruby is installed, when it was produced, and what it’s using in order to work correctly.
You can also test for Rails by typing in the following command.
1 rails -v
Hopefully this was a simple walkthrough to show you how to setup the latest version of the Ruby on Rails web development framework on the Raspberry Pi. Rails is a very popular framework, so it’s great to also have that option on the Raspberry Pi!