In this opportunity I’ll explain (as the title suggests) how to go from a brand new mac os x to running Rails tests.
Step 0, is to make sure that
(you’ll get some unexpected errors later on if not). To do so, you can either set the Language to one that Mac OS X sets UTF-8 by default, like United States from the System Preferences panel. Or, you can run
to achieve that.
Step 1, install Xcode.
Step 2, install osx-gcc-installer from
Step 3, So now you’re ready to install Homebrew, by doing:
Now this is how to install some common libraries
Step 4, We need to first have git in order run the brew doctor, so
You can make sure that everything is ok by running
$ brew doctor
Your system is raring to brew’ when in optimal conditions.
Step 5, now to install the rest of the libraries
Step 6, initializing the mysql and postgres databases must be done by doing
1 2 3
Step 7, I like having some aliases to load/unload mysql, postgres and memcached. To do so, you should add the following lines to your ~/.zshrc
1 2 3 4 5 6
Step 8, Now you’re good to go. Next we’ll install rbenv to easily switch between multiple versions of Ruby. You can also choose to use RVM or roll your own.
Step 9, Add
Step 10, now do the following to install ruby
$ rbenv install 1.9.3-p125
Step 11, you need to
$ rbenv global 1.9.3-p125
$ rbenv rehash
Step 12, Cool, so now we are good to go and setup Rails.
1 2 3 4 5
Step 13, now, from the Contributing to Rails Guide, you should
1 2 3 4 5 6 7 8 9
And that’s it!, we have Ruby, MySQL, PostgreSQL, Memcached, and everything needed to do some Rails development.
Step 14, we need to load Memcached for its needed for some tests by doing
Step 15, and lastly, you can run Rails tests by doing
at the top of the rails directory.
Everything should work just fine, or at least you should get the same results as the Rails CI.