development environment

Dependencies

XCode / Mac developer tools

Download and install the latest Xcode developer tools (Mac-only is enough)

http://developer.apple.com/technologies/xcode.html

It's required for rvm (see below) and for some gems to compile correctly

mysql

Download this mysql version (mysql-5.1.45-osx10.6-x86_64.dmg) and install the DMG:

http://www.mysql.com/downloads/mirror.php?id=385549

ruby 1.8.6

Set up ruby 1.8.6 through rvm.

rvm install 1.8.6 rvm 1.8.6 --default

FYI:

    • rvm allows you to install multiple Rubies in parallel, isolate it from the globally installed Ruby, and easily switch between them and the gems compiled for them. It installs the Rubies in your home directory.

    • We still use ruby 1.8.6 on production although there is only 1 spec which does not pass on 1.8.7

mysql gem

First check if the mysql gem was installed correctly by geminstaller. If not, uninstall it and reinstall the gem with:

env ARCHFLAGS="-arch x86_64" gem install mysql --version "2.8.1" -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

gems

gem --version

1.3.5

Upgrade with:

(sudo) gem update --system

Configuration files

To create automatically config/database.yml payment.yml facebook.yml, run rake task

rake -f lib/tasks/dev_setup.rake setup:copy_config_files setup:create_log_folder

Databases

To get test data locally, run the following task. It creates a current production data dump, imports it to your local db and does some anonymization on it:

rake db:clone_production

Working with Parallel Specs

Please read How to work with tests as we are using parallel_specs which requires 2 test databases.

Set up textmate bundles

# cucumber mkdir -p ~/Library/Application\ Support/TextMate/Bundles/ cd ~/Library/Application\ Support/TextMate/Bundles git clone git://github.com/aslakhellesoy/cucumber-tmbundle Cucumber.tmbundle osascript -e 'tell app "TextMate" to reload bundles' # haml cd /Applications/TextMate.app/Contents/SharedSupport/Bundles git clone git://github.com/textmate/ruby-haml.tmbundle.git osascript -e 'tell app "TextMate" to reload bundles' # sass cd ~/"Library/Application Support/TextMate/Bundles/" svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby Sass.tmbundle" svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby%20Sass.tmbundle" svn co http://svn.textmate.org/trunk/Review/Bundles/Ruby%20Sass.tmbundle osascript -e 'tell app "TextMate" to reload bundles' # rspec cd ~/Library/Application\ Support/Textmate/Bundles/ git clone http://github.com/dchelimsky/rspec-tmbundle.git Rspec.tmbundle osascript -e 'tell app "TextMate" to reload bundles' # current ruby on rails cd ~/Library/Application\ Support/Textmate/Bundles/ git clone git://github.com/drnic/ruby-on-rails-tmbundle.git "Ruby On Rails.tmbundle" osascript -e 'tell app "TextMate" to reload bundles'

set up culerity

You will need the celerity gem installed into JRuby:

brew install jruby -S gem install celerity

Now install the Culerity gem:

gem install culerity