1. Install XCode and homebrew
2. sudo brew install {postgresql,rbenv,ruby-build}
3. Close terminal. Open terminal.
4. mkdir proj && cd proj && rbenv install 1.9.2-p290 && rbenv local 1.9.2-p290
5. gem install rails && rbenv rehash
6. rails new foo
That should get you up and running on any OSX with a sustainable environment (i.e. one that you can actually reproduce in the future and that can mimic your live servers).
$ cat share/ruby-build/1.9.3-p125-falcon
## Hat tip to @burkelibbey and @metaskills - who did all the real work
build_package_combined_patch() {
local package_name="$1"
{
curl https://github.com/ruby/ruby/pull/47.diff | git apply
curl https://raw.github.com/gist/1859082/performance_and_backport_gc.patch | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
}
CC=$(which clang) install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
CC=$(which clang) install_package "ruby-1.9.3-p125" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz" combined_patchBeen using it at work for local dev and in production. Feels good, man.
No sudo. From https://github.com/mxcl/homebrew/wiki/FAQ:
> Why does Homebrew say sudo is bad? > tl;dr Sudo is dangerous, and you installed TextMate.app without sudo anyway.
> Homebrew is designed to work without using sudo. You can decide to use it but we strongly recommend not to do so. If you have used sudo and run into a bug then it is likely to be the cause. Please don’t file a bug report unless you can reproduce it after reinstalling Homebrew from scratch without using sudo.
Also, most of the Ruby or Rails developers I know use either rvm or rbenv to have multiple versions of Ruby installed side by side.