My environment
I’m running Snow Leopard and installed Ruby, RubyGems and Rails by following the excellent Hivelogic article.
I had mostly been using the command line for things like running tests but the bundle has that baked in allowing you to run the test you have open with a simple COMMAND + R shortcut.
Issues
The first issue I came up against was that TextMate wasn’t finding the right version of Rails.
1
| |
I assumed this was a path issue so added /usr/local/bin to /etc/profile but no luck. The solution is to add this to TextMate’s Shell Variables. Go to Preferences > Advanced > Shell Variables. Then add a row with the variable “PATH” and the value “/usr/local/bin” (or wherever you want TextMate to look).
This allows individual tests to be run but when running all tests via the bundle I got
1 2 | |
There is a ticket on the Macromates site about this. The solution is to add this line to the top of your Rakefile
1
| |
This gets over that problem but I then ran into a conflict with TextMate’s Builder file which was throwing another error
1 2 | |
I found a helpful comment on Dr Nic’s site that fixes the problem. So I did
1 2 | |
It works! Now I can run any tests I want from within TextMate with the shortcut ^/. Productivity up!