Overview
Installing Ruby on Rails can be the most challenging part of using RoR. There are many different versions of Ruby/Rails and the developer tools that go with RoR development. Every developer has their preferences and sometimes, given what your project is going to be, some choices are better than others.
Here is an outline of the tools we are going to have you install. If you have a preference for an equivalent tool, feel free to use that. In-fact if you have a good reason for using it, please add a comment with why you made that choice. Our goal here is to setup a basic development environment for someone brand-new to Ruby on Rails.
GCC
GNU Compiler Collection (or GNU C Compiler) is used to compile (translate) C code into machine language. This is used my many package managing programs to install developer tools that are need to be compiled for a specific operating system.
Ruby Version Manager (RVM)
RVM is a tool developed to help install and mange different Ruby versions on one machine. The Ruby language itself has parts written in other lower-level languages (it’s turtles all the way down!!) and needs to be compiled (translated into computer code) to suit your specific operating system. RVM takes care of the technical details of this installation process for you, allows you to run multiple ruby versions, and switch between them without conflict. RVM also allows you to manage your Ruby gems (libraries you can use that are written in Ruby), and switch between different gem-sets with ease! This allows you to use different versions of the Rails web framework gem.
HomeBrew
HoemBrew is a package management tool for Macs. On Linux, there are specific package managers for the flavor of Linux you are running. For example the package manager on Ubuntu is called the Advanced Packaging Tool (APT) and the command for using APT is apt-get or aptitude. Package managers are used to install software that has dependancies on other packages and/or needs to be compiled.
Git
Git is a source code version control system. It tracks all the changes you and any other developers have made to your application over time. It allows you to rollback changes, merge changes together, and to work on your codebase from any computer without losing changes you made somewhere else. Also, if your git ‘repository’ is on a remote server, it helps protect you from losing your application code if your machine should fail.
PostGreSQL
PostGres is an open source database that originally was designed as an open source equivalent of Oracle. It is fast and reliable data storage, in use today for many enterprise and startup applications alike! There are some really cool analytical tools that PostGres gives you for free, out-of-the-box. If you are looking for a great open source database to power your business intelligence analytics, it’s a good choice.
Heroku
Heroku is a Ruby on Rails focused web-hosting company. They provide a free hosting offering that allows us to deploy a Ruby on Rails web application out to the internet with minimal setup. Their free accounts are perfect for deploying our workshop applications out to the world quickly and easily!
Installation
The installation process for these tools differs by operating system. Find your operating system below to get started.
ALL OS’s
Signup for a free Heroku account: https://api.heroku.com/signup
Mac OS
- Install GCC: gcc is installed when you install XCode on the Mac. You can download XCode from the app store for OS X >;=10.7, or you can download XCode for your version of OS X from Apple after setting up a free developer account: http://connect.apple.com
- Test to make sure you have gcc installed by opening the Terminal program and typing in this command gcc -v if you see ‘gcc command not found’ installing gcc didn’t work. Try the gcc package here: https://github.com/kennethreitz/osx-gcc-installer
- Install RVM by following the instructions here: http://beginrescueend.com/
- Install HomeBrew by following the instructions here: https://github.com/mxcl/homebrew/wiki/installation
- Install git using HomeBrew with this command: brew install git
- Use the one-click PostGreSQL installer: http://www.enterprisedb.com/products-services-training/pgdownload or Install PostGreSQL using HomeBrew with these instructions: http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x (You should just need: brew install postgresql). NB: It will ask you for an admin password. Make it simple (“asdfasdf”?) and make sure you remember what it is!
- Install Ruby 1.9.3 using rvm using this Terminal command: rvm install 1.9.3
- Install Rails using this command: gem install rails
- Use this command to create an ssh key: ssh-keygen -t rsa
- Integrated Development Environment (IDE): http://www.sublimetext.com/2
- If you would like a visual way to see Git changes try the Github app (from the app store) or GitX: https://github.com/pieter/gitx
Linux
- Install RVM by following the instructions here: http://beginrescueend.com/
- Install Git using your OS’s package manager (apt-get or yum)
- Use the one-click PostGreSQL installer: http://www.enterprisedb.com/products-services-training/pgdownload or Install PostGreSQL using your OS’s package manager
- Install Ruby 1.9.3 using rvm using this command: rvm install 1.9.3
- Install Rails using this command: gem install rails
- Use this command to create an ssh key: ssh-keygen -t rsa
- Integrated Development Environment (IDE): http://www.sublimetext.com/2
- If you would like a visual way to see Git changes try one of these: http://stackoverflow.com/questions/1516720/git-gui-client-for-linux
Windows
- Use the one-click RailsInstaller: http://railsinstaller.org/
- Use the one-click PostGreSQL installer: http://www.enterprisedb.com/products-services-training/pgdownload NB: Remember the password you set for the “super user”! Pick something simple, like: asdf
- Integrated Development Environment (IDE): http://www.sublimetext.com/2 or http://e-texteditor.com/blog/2007/e_v10_released
- If you would like a visual way to see Git changes try tortoise: http://code.google.com/p/tortoisegit/downloads/list