HowTo install Tracks on Debian
Tracks is a web-based application to help you implement David Allen’s Getting Things Done™ methodology. It was built using Ruby on Rails, and comes with a built-in webserver (WEBrick), so that you can run it on your own computer if you like. It can be run on any platform on which Ruby can be installed, including Mac OS X, Windows XP and Linux. Tracks is Open Source, free and licensed under the GNU GPL.
I have been using tracks for some time now, as it was the best choice I could find for a ToDo software that was simple but also good looking, like some of the commercial applications that are out there. Since recently I had to move my installation to another server, I thought to document it and hopefully this might be useful for other peoples also. The official project docs are a little outdated and don’t take advantage that now debian etch has full support for all the needed dependencies and they can be easily installed from debian repositories (except tracks itself
).
The instructions will show how you can install and run tracks using MySQL and the built-in WEBrick server. You can run trakcs with SQLite/SQLite3 or Postgresql if you prefer, and for this look into the installation.html file that comes with the source.
1. Install Ruby on Rails
First we need to install the tracks dependencies. I will assume that you have already a mysql server installed and running (if not just aptitude mysql-server).
To install ruby, rails and the needed ruby packages just run:
aptitude install ruby rdoc rake rails rubygems libmysql-ruby libzlib-ruby liberb-ruby
Reading package lists… Done
Building dependency tree… Done
Reading extended state information
Initializing package states… Done
Reading task descriptions… Done
Building tag database… Done
The following NEW packages will be automatically installed:
irb irb1.8 libgems-ruby1.8 libmysql-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8 libruby1.8 rdoc1.8 ruby1.8
ruby1.8-dev
The following NEW packages will be installed:
irb irb1.8 liberb-ruby libgems-ruby1.8 libmysql-ruby libmysql-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8
libruby1.8 libzlib-ruby rails rake rdoc rdoc1.8 ruby ruby1.8 ruby1.8-dev rubygems
0 packages upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 5736kB of archives. After unpacking 26.0MB will be used.
Do you want to continue? [Y/n/?] y
As you can see this will install some dependencies, but after this finishes we are done…
2. Tracks installation
Just follow the steps outlined in the installation documentation:
- download the source
- unzip it somewhere on your system (let’s say /var/www/tracks)
- prepare the mysql database and user:
mysql -uroot -p
mysql> CREATE DATABASE tracks;
mysql> GRANT ALL PRIVILEGES ON tracks.* TO tracksuser@localhost \
IDENTIFIED BY 'tracks-password' WITH GRANT OPTION;
- open tracks/config/database.yml and comment out the SQLite3 lines and configure the production and development sections for mysql. This should look like (don’t use TABS in any of the *.yml files. Just use spaces to indent):
# MySQL settings
development:
adapter: mysql
database: tracks
host: localhost
username: tracksuser
password: tracks-password
production:
adapter: mysql
database: tracks
host: localhost
username: tracksuser
password: tracks-password
- open tracks/config/environment.rb and edit the line SALT = “change-me” to something of your choosing.
- Run ‘rake migrate’, which will create the necessary tables in your database, including some required contents:
cd /var/www/tracks
rake migrate
NOTE: for MySQL you will need to have innodb support enabled in your server since most tracks tables are innodb. If you don’t have this the rake migrate command will fail. So be sure to have this enabled.
3. Tracks usage
We are now ready to run tracks. We will use for this the build in WEBrick server (if you have other ruby application running on the system you will want to change the default 3000 port). Also will not run it as root but as a normal user (www-data the apache user):
cd /var/www/tracks
su www-data -c "ruby script/server -e production" &
In a browser go to http://yourhost:3000/signup and you will have to choose a username and password for the admin user. Thereafter, anyone else trying to access /signup will get a message that they are not allowed to sign up, and are given your email address to contact for permission.
Now you can login and start using tracks. Add some contexts, some projects and you are ready to tracks… Have fun!
Tags: debian_tools, ruby_on_rails, tracks
Share This






4th January 2008, 01:00
I found I needed to change some of the database files so that it used a valid default value for the DATETIME columns. It was trying to use ‘0000-01-01…” but valid values are only “1000-01-01…” to “9999….”
26th February 2008, 10:51
Where can I find those database files? How exactly can I change format of the data in them?
I experience the same problem as you. When I type ‘rake migrate’ it comes out a mysql error. I thought at first that my database server doesn’t support innodb, but it wasn’t the case. It supports INNODB but it still gives me an error.
Here’s the error: “Mysql::Error: Invalid default value for ‘created’: CREATE TABLE todos (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `context_id` int(11) NOT NULL, `project_id` int(11), `description` varchar(255) NOT NULL, `notes` text, `done` tinyint(1) DEFAULT 0 NOT NULL, `created` datetime DEFAULT ‘0000-01-01 00:00:00′, `due` date, `completed` datetime) ENGINE=InnoDB
”
I think there’s something to do with the Date
Please help!
26th February 2008, 14:07
Philip: you should find that file under:
tracks/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql
Myself, I have used the svn version and don’t remember to have seen this issue, but anyway, hope this path location will help you find and fix the issue
- Marius -
27th February 2008, 07:53
Thank you Marius,
But It gives me the same error!
In the specified file tracks/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql
there’s no data about table ‘todos’ and the only date there is for table ‘tasks’. I changed the date format there on 1000-01-01 for starting and 9999-01-01 for end, but that didn’t fix the problem.
I need the file that creates the table todos, because as you can see there comes the problem.
“Invalid default value for ‘created’ - 0000-01-01 00:00:00″
27th February 2008, 08:37
OK, I found the files. It’s right here:
/tracks/db/migrate/
and the files there are self explanatory
I edited 2 or 3 of them where there was a date. I changed it from 0000-01-01 to 1000-01-01 and IT WORKS.
then type ‘rake migrate’ and the tables are created correctly. After that start the server as described above and log on at http://localhost:3000/signup/
Good Luck and thanks for the tip.
Have a nice day