Skip to content
bsag edited this page Jul 16, 2011 · 1 revision

OpenSolaris

Submitted by carylt

Installing Tracks 1.7 on OpenSolaris 2009.06 using the MySQL 5.0 database in 10 steps

All the commands described in this document are to be executed by a user with the Primary Administrator role (The user created when installing OpenSolaris is granted this role automatically).

Step 1 – Download the Tracks 1.7 zip file, unzip it in your preferred location and change to that directory.

This document is written assuming the Tracks software is installed in /opt
$ cd /opt $ pfexec unzip tracks-current.zip $ cd tracks-1.7

Step 2 – Configure the OpenSolaris publisher repositories needed to install the MySQL Ruby Gem package

OpenSolaris 2009.06 is delivered with Ruby 1.8.7, which contains Ruby and RubyGems, but rather than recompiling ourselves the MySQL Ruby Gem it’s easier to simply install it directly from the OpenSolaris Contrib repository.

So we will need to add this repository to the list of available publishers of packages:

$ pfexec pkg set-publisher -O http://pkg.opensolaris.org/contrib Contrib

Now we can simply install the ruby-mysql package

Step 3 – Install ruby-mysql from the OpenSolaris contrib repository

$ pfexec pkg install ruby-mysql

Step 4 – Install, Start and Configure MySQL 5.0

Install MySQL 5.0:
$ pfexec pkg install SUNWmysql5

Start MySQL 5.0:
$ pfexec svcadm enable mysql

Creating a new user account:
$ /usr/mysql/5.0/bin/mysql -u root mysql> CREATE DATABASE tracks17; mysql> GRANT ALL ON tracks17.* TO 'mysql'@'localhost' IDENTIFIED BY 'mysql';

Step 5 – Workaround a known Ruby bug (present amongst others in OpenSolaris and BSD)

Edit the file /opt/tracks-1.7/vendor/rails/activesupport/lib/active_support/inflector.rb
Go to line 275, and add a “rescue” statement so that part of the code reads:

def transliterate(string) Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s rescue end

Step 6 – Install Rake

$ pfexec gem install rake

Step 7 – Configure the Tracks database section

Open file /opt/tracks-1.7/config/database.yml and edit the production section to look like:
production: adapter: mysql host: localhost username: mysql password: mysql database: tracks17

Step 8 – Configure the Tracks site section

Open file /opt/tracks-1.7/config/site.yml

Change the line saying salt: “change-me” to a string of your choice.
Change the line saying time_zone: “UTC” to your time zone.

You can use the command
$ /var/ruby/1.8/gem_home/bin/rake time:zones:local

to see all available timezones on your machine and test that your Ruby installation is working as intended.
If it doesn’t, chances are you missed Step 5.

Step 9 – Populate your database with the Tracks 1.7 schema

$ pfexec rake db:migrate RAILS_ENV=production

Step 10 – Start the application

$ pfexec script/server -e production

Now point your browser to http://127.0.0.1:3000 check that the application is working and create an admin user for Tracks.

Note: To ensure the Tracks application starts automatically at boot time, save the following startup script as /etc/rc3.d/S99tracks

File:S99tracks.txt

Clone this wiki locally