GTD, Ruby on Rails and the Mac
There’s been a lot of buzz on the internet about a method to Getting Things Done. I use an simple and elegant solution called Tracks. It’s made in Ruby on Rails, so to set it up can be a pain for the more technically challanged. Here’s a quick tutorial on how to set it up using Locomotive. No terminal commands needed!
Here’s what you need:
Download Locomotive. It’s a one-click solution for Ruby on Rails on Mac OS X. No funky command line commands. Install it in your Application folder as usual.
Download Tracks. Unpack it and move the tracks folder to you Document folder. Go into the config folder inside the Tracks directory you just copied. Make duplicates of the files database.yml.tmpl and environment.rb.tmpl, and rename them database.yml and environment.rb.
Open the file database.yml and replace all text in there with the following lines:
adapter: sqlite3
database: ~/Documents/tracks-1.041/db/tracks-104.db
test:
adapter: sqlite3
database: ~/Documents/tracks-1.041/db/tracks-104.db
production:
adapter: sqlite3
database: ~/Documents/tracks-1.041/db/tracks-104.db
Save the file.
Update: A lot of people have had problems with error messages like “Internal Server Error -500″ With .yml files you have to be very careful about formatting. Make sure that the config lines are indented with the same amount of spaces.
Or you could download a pre-prepared database.yml here.
Make a copy of the file environment.yml.tmpl in the config directory and rename the copy environment.yml
Make a copy of the directory called log.tmpl and change the name of the copy to log.
Now start Locomotive. When you get to the main screen, click on the plus sign at the lower left corner of the window.
Select “Add existing”
You can now add en existing Rails Application, which in this case is Tracks. So press the Choose button, and select the Tracks folder. Leave the port number to the default 3000.
Leave the rest of the settings to default values.

Press the Add button.
You should now have your Tracks application in the list.
Time to do the last changes. Select Tracks in the main window. Press the Info button in the toolbar.

Change the run mode to Production. Leave the rest of the settings.

Now close the settings window.
You should now be able to press the Run button. If everything works, there should be a green light to show that the application is up and running.
Start a web browser and point it t
Voila! Tracks!
Make sure to check the little checkbox in Locomotive so that Tracks starts automatically when launching Locomotive. Now the only thing you need to do to use Tracks is to start Locomotive. Even when your not online.
All of your Tracks data is contained in your Tracks folder. So all you need to do for backup is to copy the whole folder. Simple and easy.
If you liked this story, please Digg it!
[eminimall]

Hello,
great walkthrough! Unfortunately just after completing installing and setting up everything, I get a “500 – Internal Server Error” when trying to log in for the first time while going to http://127.0.0.1:3000/signup. How can I fix this?
Thanks, Chris
You could check the log. In the Tracks folder there’s a folder called log. Double-click on production.log. This should open the console program and show you the log. Check for error messages…
Hi,
the production.log itself is empty with no error messages. I checked the other log files in the tracks folder and here are some error messages that might indicate the problem: I checked the lighttpd.error.log and that is what comes up:
2006-05-27 14:48:23: (log.c.75) server started 2006-05-27 14:48:27: (log.c.135) server stopped 2006-05-27 14:48:29: (log.c.75) server started 2006-05-27 14:48:54: (modfastcgi.c.2430) unexpected end-of-file (perhaps the fastcgi process died): pid: 9953 socket: unix:/tmp/ruby-fastcgi.pnkhz.socket-1 2006-05-27 14:48:54: (modfastcgi.c.3168) child exited, pid: 9953 status: 1 2006-05-27 14:48:54: (mod_fastcgi.c.3215) response not received, request sent: 1023 on socket: unix:/tmp/ruby-fastcgi.pnkhz.socket-1 for /dispatch.fcgi , closing connection
Could it be a database error? Unfortunately I do not understand much about Ruby on Rails, let alone databases. I just wanted to try out Tracks.
Any suggestions? Thank’s a lot for your help!
Chris
Or could it be as simple as having to restart the machine before being able use Tracks?
I have the same problem but with this in the log:
Could not find pid file: /Users/leonpereiraphd/tracks-1.041/log/locomotive.pid (TerminateApp::PidFileMissingError)
Put the tracks folder in your Documents folder. Change the database.yml to reflect that. For example:
production: adapter: sqlite3 database: ~/Documents/tracks-1.041/db/tracks-104.db
Note: I tried to put it in the desktop folder but then I got Internal server error 500.
Hi,
sorry I still get a 500 Internal Error even when putting the tracks folder in Documents and adjusting database.yml and adding the new tracks folder to Locomotive.
I now tested it both under my daily account and my admin account. Same behavior.
What can I do?
I found the problem! yml files are very perticular about spacing. I managed to mess up the text when adding it to my posting. You can now download a pre-prepared database.yml (see link in text above)
This should fix it.
Jacken
Hi Jacken,
now it works! Awesome – thanks a lot! Thanks for your great work!
Best regards, Chris
I am stuck at your instruction “Make a copy of the file environment.yml.tmpl in the config directory and rename the copy environment.yml”. There is no such file in the config directory of the distribution I downloaded (tracks-1.041).
Thanks Alex
I found the problem. Although there was no environment.yml.tmpl in config, the real problem seemed to lie with database.yml. Expanding the tilde to full path fixed it.
Thanks for the walkthrough though. It made it almost too easy. Alex
Nice work! As Alexandre notes, the image of the Locomotive “Add existing” screen should have
~/Documents/tracks-1.041
instead of “~/tracks-1.041″, and the environment.yaml.tmpl is definitely awol (but ignoring it does no harm). With those changes everything’s really smooth; thanks very much for the instructions,
Paul
When I try to open database.yml it says there is no default application to open that file asks me what to choose an application to use. What should I do? Thanks.
You need a text editor. Download TextWrangler (free) or my favorite TextMate.
Thanks. Now when I go to http://127.0.0.1:3000/signup, Safari says that it can’t connect to the server.
I’m having the same problem (or a similar problem). I’ve carefully followed all directions including the advice about spacing in the database.yml file, and Tracks does seem to run in Locomotive, but when I go to the signup address I get a 500 error message. I have tried Firefox and Safari (but I don’t think the browser is the problem). I am running OS X 10.3.9 FWIW.
In desperation I also installed Ruby and Rails and all the other bits by hand, meticulously following the directions, including a fresh install of Xcode and MySQL, and tried to run Tracks that way, and the same error message showed up. So I’m wondering if this isn’t a more subtle bug.
I still can’t connect to that url. I get this message : Safari can’t open the page “http://127.0.0.1:3000/signup†because it could not connect to the server “127.0.0.1â€.
Any thoughts?
Thanks.
Mark: Try to connect to http://0.0.0.0:3000/signup instead.
I have Tracks set up in a hosted arrangement eliminating the need to go through the motions of a local installation. I will be opening this up to the public and making enhancements. In the meantime, if you would like a free ‘beta’ Tracks account to use for personal use or demo purposes please send an email to brightpoolatgmail.com (Edit for spam.) and include the username you would like assigned to you. You will be emailed back promptly with a password and login instructions. Thanks!
-Kevin
hi! i’m also hosting Tracks for free at: http://tracks.tra.in
you can go ahead and sign up without having to email me. i started out using locomotive (after reading this blog post) locally, but then wanted to be able to access Tracks from anywhere. then i enabled open signups.
i also made some slight feature/design tweaks and have more ideas (like a more gmail-esque interface), though it’s pretty nice ‘n’ elegant already.
hope this helps!
I get a stacktrace (NoMethodError in Login#signup). This is sooo annoying; it also happens with an SVN checkout.
Doubly annoying.
The problem for those who go to /signup and get a NoSuchMethod exception is “fixable”:
sqlite3 ~/Documents/tracks-1.041/db/tracks-104.db ‘delete from users;’
It’s a bug, but I’m no Rubyist; I’ll check bsag’s Trac and drop him a ticket.
I’ve built on the instructions above and added some instructions for using mySQL instead of sqllite. Inlcuded is a SQL script for setting up the db and tables: http://www.mikekrisher.com/2006/07/using-rails-app-tracks-with-mysql.php
@Leon: make sure there’s a log folder inside the tracks folder (mine didn’t have one) and that should solve the PID problem.
I get “could not open database” and a lot more text when I go to the browser. Did I miss a step? Or do I have to ‘turn on’ the database?
I am also getting a “could not open database” error. Here are the first two lines of the error report that appears on the browser window:
could not open database /Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/errors.rb:94:in
/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/database.rb:112:in
Is this an issue that only affects the new version of locomotive or tracks? I am trying to install it in a Macbook.
I was also getting the “could not open database” error and replaced Documents/tracks-1.041 in the yml file with Documents/tracks_1.042 – seems to work now
Thalia, that was elegantly simple and beautiful. I’m now on track, sort of speak. =)
Thx Jacken for this wonderful article.
Replacing didn’t't seem to work for me but instead I found a Rails server, so Tracks is working for me now.
Hi,
doesn’t work for me: I have carefully changed all the text lines to my path (/Documents/tracks_1.042/db/tracks-12.04.db) but still get the “could not open adatabase” error.
Any further suggestions? If it stays as complicated just to have a look at tracks its not for me… Still would love to have a try.
Greetings, Rolf
Rolf – you can try it at http://tracks.brightpool.com/login
I am running 1.043 on a Macbook pro and get the server error on 127.0.0.1 and 0.0.0.0. I have changed the db file in the config to reflect 1.043 and have the file in the docs folder. Any suggestions? Any changes in 1.042 or 1.043 that render the instructions in accurate? Perhaps something in my browser settings (I’ve tried both firefox and safari.
Thanks!
I don’t have these files in my config directory: environment.yml.tmpl, log.tmpl.
The comments of others were great in getting tracks up and running in Locomotive. However, now I’ve found a coincident problem. I’m not sure it’s related in anything except time. Here goes – my Chronos SOHO Notes has quit working. Well quit is too strong. It no longer finds its related Openbase database. It now tries to connect to 127.0.0.1 and when it cannot find the database there reports that fact and quits. So Notes tries to connect to the database, then tries to create the database, and failing at both, quits. Has anybody else run into database or database location conflicts?
Bob, I don’t have either..
If you do download the database.yml file, it is out of date regarding the version of Ruby you will install. So, first thing you must do is change that from
production: adapter: sqlite3 database: ~/Documents/tracks-1.041/db/tracks-104.db
to
production: adapter: sqlite3 database: ~/Documents/tracks-1.043/db/tracks-104.db (or whatever version of tracks is in the Documents folder.
In spite of all this, I still had the internal error 500, but stopping Locomotive and restarting it solved it.
I just installed everything and followed the directions and I’m also getting the dreaded “Can’t connect to server at 127.0.0.1:3000. I did make sure the database.yml file was updated to reflect the new folder name for tracks.
The production.log file is empty, not showing any errors.
Any suggestions?
Thanks, Ray
An update. I did a little investigating and it looks like the january version of Locomotive has problems, so if you go find your config/locomotive.yml file and add this line to the end:
server: lighttpd
You won’t get any further “can’t connect to server” errors, at least in my case and a few others.
Now my problem is finding the database – I’m getting the following errors: Any suggestions?
could not open database: unable to open database file /Applications/Locomotive2/Bundles/standardRailsJan2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.0/lib/sqlite3/errors.rb:94:in
/Applications/Locomotive2/Bundles/standardRailsJan2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.0/lib/sqlite3/database.rb:112:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:17:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/activerecord/lib/active_record/base.rb:696:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:103:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:281:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:281:in
/Applications/Locomotive2/Bundles/standardRailsJan2007.locobundle/powerpc/lib/ruby/1.8/cgi/session.rb:273:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/cgi_process.rb:111:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/cgi_process.rb:107:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/flash.rb:141:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/actionpack/lib/action_controller/filters.rb:364:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/railties/lib/dispatcher.rb:38:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:54:in
/Applications/Locomotive2/Bundles/standardRailsJan2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
/Users/Solari/Documents/tracks-1.043/public/../config/../vendor/rails/railties/lib/fcgi_handler.rb:53:in
Okay, I did some more investigating… I found out if I downloaded an earlier version of Locomotive (2.02), everything started working… With tracks 1.4.3.
Dunno why the database won’t connect under 2.08 of Locomotive.
Hope this helps some of you.
Ray
As Ray indicated, it won’t work with 2.0.8 Locomotive “out of the box”. Tracks appears to be incompatible with Rails 1.2.1+ so you just need to download the RMagickRailsSep2006 bundle for Locomotive from here (under the Bundles section):
http://sourceforge.net/project/showfiles.php?group_id=146941
…and place the bundle in the “Bundles” directory (this dir is in the same dir as the Locomotive.app). Then when you create your tracks loco entry, select “RMagick Rails Sep 2006″ in the drop down to use an older version of Rails. This got me up and running with the rest of the instructions above.
Thanks for the tutorial!
Oh, forgot one more thing I had to do… the ‘boot.rb’ file in the /config directory has a reference to railties which I had to remove for the application to start. I changed my boot.rb to look like this (basically commenting out the “if”):
if File.directory?(”#{RAILS_ROOT}/vendor/rails”)
require “#{RAILS_ROOT}/vendor/rails/railties/lib/initializer”
else
require ‘rubygems’ require ‘initializer’
end
..it seems that Tracks 1.0.43 expects railties to be in the /vendor/rails dir, but its not included in the Zip file.
Well, since the comment formatting blitzed my code, I’ll try one more time… at the bottom of the boot.rb file, I did this:
If it fails miserably again, just comment out the first 3 lines (”if”, “require”,”else”) and the associated “end” (last line).
I just tried to install following all the instructions and ended with commenting out the IF ELSE END.
Now Tracks starts, but immediately neds with page fulls of erros messages, the first of which is:
Status: 500 Internal Server Error Content-Type: text/plain Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) /Users/chris/Documents/tracks-
I guess taht all the following ones are a consequence of thsi one.
What now?
Any help is really appreciated.
Chris
For what’s its worth I was having problems getting this to work until I moved the Tracks folder to my Sites folder and changed this:
development: adapter: sqlite3 database: ~/Documents/tracks-1.041/db/tracks-104.db
test: adapter: sqlite3 database: ~/Documents/tracks-1.041/db/tracks-104.db
production: adapter: sqlite3 database: ~/Documents/tracks-1.041/db/tracks-104.db
to:
development: adapter: sqlite3 database: ~/Sites/tracks-1.043/db/tracks-104.db
test: adapter: sqlite3 database: ~/Sites/tracks-1.043/db/tracks-104.db
production: adapter: sqlite3 database: ~/Sites/tracks-1.043/db/tracks-104.db
and then http://127.0.0.1:3000
and presto… Tracks on my mac.
Thanks for the handy installation and the help.
Hi, thanks and this helped me lot, but i face problem in starting Ruby server. I downloaded locomotive for MAC (StandardRailsMar2007.dmg) and installed the package in Appliactions/My Rails . I had given given all the parameters in locomotive.yml as below mode: development bundle: /Applications/”My Rails”/Bundles/standardRailsMar2007.locobundle port: 3010 runsatlaunch: 0 identifier: ProjectX
and i am trying to start the server , but it is not starting.Its giving errors
The server starts if bundle path is /Applications/MyRails/Bundles/standardRailsMar2007.locobundle and the difference is MyRails folder has space in the above. Why the server doesnt start if folder name has spaces.Is this a bug? and how can i resolve this situtation, can any one guide me in the right direction