This is a brief step-by-step guide about how to setup Ruby development environment on Ubuntu.
All the commands here are to be run from terminal (command prompt)
1. Update Linux package management
sudo apt-get update
2. Install C/C++ tools to build native libraries (You might never use them directly, but Ruby gems use them)
sudo apt-get install -y build-essential
3 - Install curl (command line HTTP client, used to download binary packages)
sudo apt-get install -y curl
4 - Install RVM (Ruby version management)
Run these 2 commands:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable
After RVM installation finish, you will see this message:
Copy the part that I highlighted in the photo (on your computer the path might be different), and run it inside terminal:
5 - Install Ruby via RVM
rvm install 2.2.3 -- --enable-shared
After the installation is done, run the following command to set Ruby version 2.2.3 as default version
rvm use --default 2.2.3
6 - Install bundler (bundler is Ruby gem management tool)
gem install bundler
7 - Install vim (or gedit if you run Ubuntu with GUI and are too lazy to use vim)
sudo apt-get install -y vim
sudo apt-get install -y gedit
8 - Install git
sudo apt-get install -y git
9- Generate SSH keys
Look at the guide here on github.
SSH keys are used not only for remote access to remote servers, but also used to perform asynchronous encryption.
10. If you want to disable the installation of RDoc and Ri each time you install a gem (I disable it on my computer to save time and space)
Change to your home directory
Create a file named .gemrc (with a dot at the beginning), that has the following content
gem: --no-rdoc --no-ri
Now you are good to with Ruby.
Later on, you will need to install database and some other additional tools when you work further with software development.