Installing Redmine on OS X

This post is too old to be of any use. It has been archived.

Redmine is an issue management tool I like using, as it looks professional, it's very customizable, and it's reasonably easy to install. Here's how I have installed it on OS X, and the issues I found.

Checking out and installing Redmine

The official Redmine installation instructions are clear enough. Everything is done on the command line.

# check out code from svn
$ cd ~/src
$ svn co redmine-2.2
$ cd redmine-2.2

# run installation scripts
$ bundle install --without development test postgresql sqlite

# configure redmine to use database
$ cp config/database.yml.example config/database.yml;
$ subl config/database.yml

# in the config file, I left only the production database, as this is my dev machine
# production:
#  adapter: mysql2
#  database: redmine
#  host: localhost
#  username: redmine
#  password: my_password

# create database
$ mysql -u root
> create database redmine character set utf8;
> create user 'redmine'@'localhost' identified by 'my_password';
> grant all privileges on redmine.* to 'redmine'@'localhost';
> exit;

# generate secret token
$ rake generate_secret_token

Error: please install the mysql2 adapter

It was going well - obviously it couldn't last. When I tried to run the scripts that setup the database schema, I started getting errors.

$ RAILS_ENV=production rake db:migrate
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (dlopen(/Users/ME/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib

Some intensive Googling revealed the solution - I had to edit the Gemfile, subl Gemfile.

platforms :mri_18, :mingw_18 do
  group :mysql do
    gem "mysql", "~> 2.8.1"

platforms :mri_19, :mingw_19 do
  group :mysql do
    gem "mysql2", "~> 0.3.11"

gem "mysql2", "~> 0.3.11"

## Error: dlopen... Library not loaded: libmysqlclient.18.dylib
Still not happy about that libmysqlclient

$ RAILS_ENV=production rake db:migrate
dlopen(/Users/ME/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib

This StackOverflow answer revealed the answer

$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
$ RAILS_ENV=production rake db:migrate

Problem solved

Running Redmine

As I am only running Redmine locally, I am happy with using the Webrick webserver. This is built as a dev tool, it's not really suitable for hosting production websites.

ruby script/rails server webrick -e production

I can then access Redmine through the local address, http://localhost:3000/. The default credential to get in are admin / admin.


Hope this may come useful. There is more Redmine documentation if you need it.