-
-
Notifications
You must be signed in to change notification settings - Fork 537
Install Tracks 2.1 on Ubuntu 12.04
This is a guide to get a minimal version of tracks running on Ubuntu 12.04 (precise).
You will need a few packages before installing Tracks.
sudo apt-get install rubygems build-essential libssl-dev libxml2-dev libxslt-dev libsqlite3-dev libmysqld-dev ruby-rvm
sudo rvm package install openssl
*Note: debian users will need to omit package from the last command above
Install ruby 1.8.7 with rvm:
sudo rvm install ruby-1.8.7 --with-openssl-dir=/usr/share/ruby-rvm/usr
sudo gem install rdoc bundle
We now get the latest source code for Tracks and switch to the 2.1 branch. Navigate to the directory that you want to install Tracks in and do the following:
git clone https://github.com/TracksApp/tracks.git
cd tracks
git checkout 2.1_branch
cd ../
sudo chown -R www-data:www-data tracks
Update the Gemfile to use version 4.6.0 of ZenTest:
gem "ZenTest", "=4.6.0"
You can use MySQL、Postgresql or SQLite for the Tracks database. If you only plan to use one of these, edit the Gemfile and comment out the one you don't want. For example, if you do not want to use SQLite, comment out the line requiring it like this.
# gem "sqlite3"
Install the remaining gems by calling bundle:
sudo bundle install
This might take a long time!
If you are planning to run Tracks under Apache with the Passenger module, keep in mind that Passenger will not recognize gems specified in the Gemfile as coming from Git. The workaround is to do the following instead:
sudo bundle pack
sudo bundle install --path vendor/cache
More details can be found in this forum post.
sudo cp config/database.yml.tmpl config/database.yml
sudoedit config/database.yml
Edit database.yml
based on the type of database you plan to use. The minimal install uses SQLite 3 (this eliminates the need for installing and running MySQL) but you can easily use MySQL by editing database.yml
accordingly.
sudo cp config/site.yml.tmpl config/site.yml
sudoedit config/site.yml
After creating the database, you need to initialize the database for the production system. You can also initialize it for the development system, however, for practical use, the production system is sufficient:
sudo bundle exec rake db:migrate RAILS_ENV=production
The easiest way for running tracks is using Ruby's server. This eliminates the need for configuring Apache, Mongrel, etc. Hence, the setup also will not scale, if you intend to support multiple users. Just run the server with:
./script/server -e production
Your system should now be up and running. Try to access the website:
sudo apt-get install libapache2-mod-passenger
Configure Apache to use Passenger to run your Tracks site. This is beyond the scope of this document, but you can find some great documentation in the [Passenger users guide](http://www.modrails.com/documentation/Users guide Apache.html).
A sample virtual host using libapache2-mod-passenger. Passenger will auto-detect the rails app.
<VirtualHost *:80>
ServerName tracks.local
DocumentRoot {PATH_TO_RAILS_APP}/public
</VirtualHost>
Tracks should should now be online, either at http://example.com:3000 (if you are running Ruby's server) or at whatever address you told Apache to use.
Load it up and get started!