Problems Installing Rails 3 on a new Machine

Trying to install rails 3 on a new macbook pro.

$ rails -v
Could not find bcrypt-ruby-2.1.2 in any of the sources
Try running `bundle install`.

$ bundle install
.
.

Installing bcrypt-ruby (2.1.2) with native extensions /Library/Ruby/
Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR:
Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/
Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/bcrypt-
ruby-2.1.2 for inspection.

Try running gem clean up to see if there is a dependeci problem

Turns out I needed to install xcode on the mac - that fixed it