Day 1: Setup

Mac OS X


If you don’t have Ruby installed, follow these instructions from 7 Days of Ruby tutorial.


We’re going to use the database called PostgreSQL aka Postgres. It’s simple to install and use. It’s supported by many platforms. Let’s install it using Homebrew. We’ll also configure Postgres to run locally.

$ brew install postgresql
$ echo “export PGHOST=localhost” >> ~/.bash_profile
$ echo “export PGDATA=/usr/local/var/postgres” >> ~/.bash_profile
$ source ~/.bash_profile

Following commands make it so Postgres starts up on boot. It’s convenient. You won’t need to start it manually every time you reboot.

$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Now it’s time to create a database user for our application.

$ createuser todo -s</pre>


Now is time to install Rails framework. Rails is distributed as a ruby gem. RubyGems is a packaging system that comes with ruby installation. We’ll need to use gem command to install it

$ gem install rails --version 4.0.2</pre>

IDE (Integrated Development Environment)

I recommend to start with RubyMine. I used it myself to start with. It does a lot of stuff for you automatically so you can focus on learning how to program instead of configuring your development environment. Download and install the 30 days trial from JetBrains website.

What happened here ?

Now you have all necessary software to start programming. Can’t wait to write a first line of code ? Let’s learn how to do it.

Photo by ooocha