Redmine is a project management web application, developed in Rails. In my opinion is the best free tool of this nature. That’s the reason why I wanted to install it on my server, to manage better my future projects, and of course installing the last version. In this article I will ilustrate the dificulties which I found during the installation, mainly the first installation of ruby, rails, bundler, mysql compatibility …
Install RVM
I found the RVM(Ruby Version Manager), a software to change from one ruby version to another and to make easy the installations of several versions of ruby in your computer. For me was the only way to install ruby 1.8.7 without the ubuntu packages 🙂 :
#Install RVM apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core patch zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion curl -L get.rvm.io | bash -s stable source /etc/profile.d/rvm.sh rvm install 1.8.7 |
The last command is the one which you can use to install a new ruby version. It’s an easy way to install jruby too. After  that you have to install Rails 3.2 and the connectors to mysql:
gem install rails sudo apt-get install libmysql-ruby libmysqlclient-dev |
Install Redmine
Now you need to download and prepare the redmine 2.0 installation:
git clone git://github.com/redmine/redmine.git -b 2.0-stable chown -R www-data:www-data redmine/ cd redmine gem install bundler bundle install --without development test postgresql sqlite rmagick |
Create database:
create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'my_password'; grant all privileges on redmine.* to 'redmine'@'localhost'; |
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for “production” environment.
production: adapter: mysql database: redmine host: localhost username: redmine password: my_password |
Generate a session store secret.
rake generate_secret_token |
Create the database structure, by running the following command under the application root directory:
RAILS_ENV=production rake db:migrate |
Insert default configuration data in database, by running the following command:
RAILS_ENV=production rake redmine:load_default_data |
Install Apache2/Passenger
Install passenger:
apt-get install libapache2-mod-passenger |
Installation folder in: /usr/share/redmine
sudo ln -s /usr/share/redmine/public /var/www/redmine |
Configure passeger (connecor apache2-ruby) /etc/apache2/mods-available/passenger.conf, add:
PassengerDefaultUser www-data |
configure the /var/www/redmine location in /etc/apache2/sites-available/default by adding on the Directory tag:
RailsBaseURI /redmine PassengerResolveSymlinksInDocumentRoot on |
After We move the old redmine installation to /usr/local/redmine. And load the old database to redmine_default.
The default user is admin/admin. Enjoy!
Inside config/database.yml change the adapter from mysql to mysql2
Else it will throw an error when you try to migrate.
Even after changing the adapter from mysql to mysql2 in config/database.yml, I still continue to get the following error:
root@linuxdev1:/var/www/redmine/config# RAILS_ENV=production rake db:migrate
(in /var/www/redmine)
rake aborted!
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)
Any help is appreciated. Thanks!
Thanks for the howto – it would be great, if you could also describe how to upgrade to a newer branch of redmine! I think git clone -b does NOT create a tracking branch?