Budgie Smuggler: Ruby Development Environment Setup on Linux Solus 3

Jules Nuggy
Makers
Published in
9 min readJan 31, 2018

--

For Makers Academy (MA), I decided to install Linux onto my machine as I don’t have a Mac and trying to work with bash on Windows is like trying to guide Natalya Simonova in GoldenEye 007 (N64) into that damn main control room that she insists we should go to: slow, painful, you’ll die and/or kill Natalya several times.

For those not familiar and with 4 spare minutes, here’s a fan remake of a Natalya escort mission

INFO: bash = Bourne Again Shell, the standard Unix shell and command language deployed in Linux OS’ which runs in the Terminal

My boyfriend did a bit of research for me and recommended I give the Solus distro a try (Solus 3 ‘Budgie’, specifically). Being an open source OS, Linux has multiple different distros, all operating slightly differently. Ubuntu and Debian are two of the most widely used distros but I like to try to be different and support the underdog (which is just another way of saying that I’m a Linux Virgin and don’t know any better).

The problem with this philosophy in this instance is that all the material I was provided to set up my development environment was generally geared towards Ubuntu, Debian and other more “mainstream” distros. Solus uses a number of different syntaxes, libraries and nomenclatures compared to these and it wasn’t an easy task finding all the right information in one place — especially for a Lin00b (Linux n00b)like myself.

So, this article is intended to provide all that information in one place to hopefully guide others who may want to do the same as me. I installed the following tools / packages on my laptop (Dell XPS15):
— Ruby Version Manager (RVM) & Ruby
— Git
— Heroku
— Linuxbrew
— Node js

For reference to MA students who may be reading this, these are the tools / packages which you will install as per the http://www.preparetocode.io/linux/essential instructions. These are only geared towards the Ubuntu distro and I’ve found some of the steps to be outdated.

NOTE: When copying and pasting code from this guide, replace all text contained between curly brackets (including the brackets themselves) with text relevant to you. e.g. { user_name } => julesnuggy

Installing Ruby Version Manager (RVM) & Ruby

— Step 1 —
Type in the terminal:

sudo eopkg install -c system.devel
sudo eopkg install ruby-devel
sudo eopkg install sqlite3-devel
sudo eopkg install nodejs

You will need to enter your Solus 3 account password when prompted.

This will help save some time when RVM tries to install the missing dependencies for Ruby to run on your system.

INFO: the system.devel dependency package is equivalent to the Ubuntu version called “build-essential” and includes the following dependencies:

abireport | autoconf | automake | binutils | bison | bison-devel | catbox
cmake | diffstat | diffutils | fakeroot | file-devel | flex | flex-devel
g++ | gcc | gettext-devel | gfortran | glibc-devel | gmp-devel
gobject-introspection-devel | intltool | libffi-devel | libgcrypt-devel
libgpg-error-devel | libgudev-devel | libtool-devel | libxml2-devel
linux-headers | m4 |make | meson | mpc-devel | mpfr-devel
nano | nasm | ncurses-devel | openssl-devel | pam-devel | patch
perl-xmlparser | pkg-config | python-devel | quilt | readline-devel
texinfo | util-linux-devel | xz-devel | ypkg | zlib-devel

— Step 2 —
After installation, in the menu bar of the Terminal, click on ‘Edit’ → ‘Profile Preferences’ and a window will open. Click on the ‘Command’ tab and, under the ‘Command’ sub heading, tick the “Run command as a login shell” option and restart the terminal. They say a picture tells a thousand words — here’s one which tells 44:

— Step 3 —
Check the latest stable version number of Ruby here — it will be in the format X.Y.Z (e.g. I installed version 2.5.0 in January 2018). Alternatively, if you’ve been instructed to install a specific version, then go with that. Then type in the Terminal:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

If you encounter problems with this key, check here. Once it has finished installing RVM, install Ruby by typing in the Terminal:

\curl -sSL https://get.rvm.io | bash -s stable --ruby={ X.Y.Z }

Once Ruby has installed, there will be a note at the end saying you will need to run:

source /home/{ YOUR_USER_NAME }/.rvm/scripts/rvm

Simply copy, paste and run the command as it is displayed in your Terminal. With this, RVM should now be installed on your system. You can check that it has installed correctly by checking the version number by typing in the Terminal:

rvm -v

— Step 4 —
After successful installation, type in the Terminal:

rvm alias create default { X.Y.Z }
rvm use default

This sets the Terminal to use the version of Ruby that you would like (in this case, the latest stable version that you’ve just installed). You can change this default at any time. To check the version you’ve installed is being used and is the default, type in terminal:

rvm list

This will show all versions of Ruby that you have installed on your system, and =* should be displayed to the left of version X.Y.Z that you have just installed, signifying that it is the default version and the one currently in use.

— Step 5 —
This is a “double-check that things have installed correctly” step. Close all Terminal sessions that you have open (this is important); start a new session; and check the RVM version number again (rvm -v). If you get an error message which looks something along the lines of this:

FEAR NOT! You should be able to rectify this by simply typing in the Terminal:

rvm reset

When you run this, the error message will still appear but once you close and re-open the Terminal and run rvm -v again, it should be gone. It seems ridiculous to have to reset RVM when you’ve JUST installed it, but this is the fix which worked for me. If it doesn’t for you, check out some of the other potential solutions here.

— Step 6 —
Finally, install the bundler and Ruby on Rails by typing in the Terminal:

gem install bundler
gem install rails

— Step 7 (Optional)—

Once you’ve installed RVM, you can simply install any other version of Ruby by typing in the Terminal:

rvm install { X.Y.Z }
gem install bundler

You need to use Bundler to install the correct gems for each version of Ruby you install as they will likely use a different set or version of gems.
“OK, but WTF are gems?!” I hear you asking yourself.

A ‘gem’ is a software package which contains a packaged Ruby application or Library. These packages are downloaded and installed via the RubyGems software, which is built into all versions of Ruby from version 1.9 onwards.

“Gems can be used to extend or modify functionality in Ruby applications. Commonly they’re used to distribute reusable functionality that is shared with other Rubyists for use in their applications and libraries. Some gems provide command line utilities to help automate tasks and speed up your work.”

— Source: http://guides.rubygems.org/

Phew! OK, that’s RVM and Ruby installed on your system! This is the installation which requires the most steps in this guide, so the rest is relatively easy… (Famous last words)

Installing Git

— Step 1 —
Before starting, make sure you’ve set up a GitHub account.

— Step 2 —
Once you’ve signed up, type in the Terminal:

sudo eopkg install git

You will need to enter your Solus 3 account password when prompted.

Once it finishes installing, type the following into the Terminal, replacing the bold text with your own account details:

git config --global user.name {Your_User_Name}
git config --global user.email { you@your-domain.com }

Remove the curly braces in both cases when entering this, and you’ll need the quotation marks for your user name (e.g. “John_Doe”), but not your email (e.g. John.Doe@JDMail.com).

The global option means that this setting will apply to every repository that you work with in the current user account.

— Step 3 —
To enable colours in the Git output, which can be very helpful, enter the following in the Terminal:

git config --global color.ui true
git config --global color.ui auto

— Step 4 —
In order to connect to Git with a secured connection, you will need to generate a SSH key. Do so by typing in the Terminal:

ssh-keygen -t rsa -C { you@your-domain.com }
cat ~/.ssh/id_rsa.pub

Remove the curly brackets when pasting the first line. Copy the entirety of the key which outputs from the second command, go to the GitHub SSH page and click on the green “Add New Key” button. Give it any name and paste the key which was outputted above into the key box. Click “Add SSH key”.

Back in your Terminal, type:

ssh -T git@github.com

and type “yes” to continue. It should say that you have successfully authenticated.

And you’re done! See, easy!

Installing Heroku

This is a pretty straight-forward process. Ironically though, it is also the one which was the biggest pain in the hassle for me because I was so thrown off by the preparetocode.io instructions using the wget method (which is only for Ubuntu). I probably spent an hour or so trying to do this on Solus 3, but it should only take about 5 minutes if you know what you’re doing… which you will, following these 3 steps!

— Step 1 —
Ensure you have a Heroku account set up first.

— Step 2—
Type in the Terminal:

sudo snap install heroku --classic

Enter your Solus 3 account password to continue.

— Step 3 —
Type in the Terminal:

heroku login

And enter your account details.

That’s it!

Installing Linuxbrew

Another easy one.

— Step 1 —
Type in terminal:

sh -c “$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Once complete, follow the ‘Next Steps’ instructions provided in the terminal, but skip the first ‘Next Step’ about installing dependencies has already been completed in the first step of this guide (via system.devel). In short, you should:

  1. Run the three echo commands to add the three environmental variables to your bash profile.
  2. Add Linuxbrew to your PATH env var so that the Terminal knows where to look for the Linuxbrew program.
  3. Install GCC.
  4. To verify that is has installed correctly, ensure there are no error messages when you run:

brew doctor
brew update

The ‘Next Steps’ dialogue for Linuxbrew

“The GCC (GNU Compiler Collection)… contains compilers for the C, C++, Objective C, Fortran, Java and Ada programming languages).“

— Source: http://www.linfo.org/gcc.html

Installing Node JS

Last one! And it’s the simplest one of the lot.

— Step 1 —
Type in the terminal:

brew install node

— Step 2 —

Test correct installation by checking the version numbers:

node -v
npm -v

And you’re done… with all of the installations to create a Ruby development environment on your Solus 3 OS!

If you encounter any errors while following this guide or if you have any questions, please let me know!

--

--