Skip to content

Instantly share code, notes, and snippets.

@pjkelly
Created December 13, 2010 17:13
Show Gist options
  • Save pjkelly/739236 to your computer and use it in GitHub Desktop.
Save pjkelly/739236 to your computer and use it in GitHub Desktop.
Instructions for setting up a Rails development environment using Cinderella

These instructions are for Snow Leopard only.

XCode

Ensure that you have XCode for the version of OS X you're running. These are not installed by default on new machines and can be installed off the OS installation DVD. If you're not sure, run the following command. It should return something like this: /usr/bin/gcc; if it does not, you need to install XCode.

which gcc

SSH Keys

If you have SSH keys setup already

If you already use GitHub, this will be the case. You don't have to do anything.

If you have SSH keys setup on a previous computer

Do the following on your old computer:

cp ~/.ssh/id_rsa ~/Desktop/id_rsa && cp ~/.ssh/id_rsa.pub ~/Desktop/id_rsa.pub

Move the generated files to the desktop of your new computer, then on the new computer run the following:

mkdir -p ~/.ssh && cp ~/Desktop/id_rsa ~/.ssh/id_rsa && cp ~/Desktop/id_rsa.pub ~/.ssh/id_rsa.pub

If you don't have any SSH keys

Follow this tutorial.

Github

If you don't have one already, create a GitHub account. You can use the free account. Once your account is active, complete the following tutorial to make sure everything is hooked up correctly:

Cinderella

Cinderella is a fully managed development environment for open source hacking on Mac OSX. It's powered by rvm, homebrew and chef. You only need Xcode to get started.

Running the following command will install a complete development environment for you. The command will take approximately 45 minutes to run, and you will be prompted for your user password at the beginning.

curl https://raw.github.com/atmos/cinderella/master/bootstrap.sh -o - | sh

Once this is complete, you will want to make a directory in your home folder called "Projects"; we checkout all our source code into this folder for consistency’s sake.

Finally, Cinderella has completed, restart your Terminal so all the shell changes can take effect.

Note

Frequently, the initial Cinderella install will fail out. Most often this is related to a failed installation of postgresql. If this happens, just run the command above again and it will pick up where it left off. Most of the time running it a second (or sometimes third) time will fix the issue on its own.

Ruby Setup

Now that Cinderella has run, you have RVM on your system for managing Ruby versions. We use Ruby Enterprise Edition 1.8.7 primarily on our applications so we recommend installing that and setting that as your default Ruby. Doing so is easy:

rvm install ree-1.8.7
rvm --default use ree-1.8.7

From now on, anytime Ruby is invoked from the shell, ree-1.8.7 will be the version used.

ImageMagick Symlinks

We use ImageMagick frequently on our projects, and we need to create some symlinks to your installation so Rails can find it. Be sure to replace [username] with your Mac OS username.

sudo mkdir -p /usr/local/bin
sudo ln -s /Users/[username]/Developer/bin/identify /usr/local/bin/identify
sudo ln -s /Users/[username]/Developer/bin/convert /usr/local/bin/convert

Application Setup

Setup that is specific to the application you're working on will be provided in the README.markdown file inside that project's Git repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment