Redmine Version 3 onto Raspberry Pi 2

This is going to be much less detailed than my post to install version 1.x of Redmine. This is a much more intense process, but I’ve done all the work for you. It’s possible I made a small error or two, but it should be pretty easy to work through if I did. I’ve done most of the work getting past all the really hard errors in the process.

This also assumes you’ve already done the regular Redmine install, though it’s not required.

Following along with http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade but filling in the gaps to get it working on the Pi 2.
unzip redmine 3 to /usr/share/redmine3/ ensuring it doesn’t create a root directory inside there. (I extracted as redmine-3.0.1 and then renamed the folder)
sudo chmod 777 -R redmine3
sudo chown pi:pi -R redmine3
Now if you try the bundle install command, it won’t work. Why? Because the Pi has too low of a version of Bundler. Soooo, we have to uninstall it from apt-get, install a “fake” package, and then install the updated version straight through ruby.
sudo apt-get update
sudo dpkg -r –force-depends “bundler”
Download my fake bundler package here.
sudo dpkg -i bundler_1.9.4_all.deb
Now inside the redmine3 directory
sudo gem install bundler –version ‘1.9.4’
sudo apt-get install ruby1.9.1-dev
sudo gem install json -v ‘1.8.2’
sudo apt-get install libmysql-ruby
sudo apt-get install libmysqlclient-dev
sudo gem install mysql2 -v ‘0.3.18’
cp /etc/redmine/default/database.yml /usr/share/redmine3/config/database.yml
sudo chmod 777 config/database.yml
sudo chown pi:pi config/database.yml
nano config/database.yml and change mysql to mysql2
bundle install –without development test rmagick
This should now actually work since we did the pre-reqs, and it is going to take awhile. 10+ minutes on the Pi 2.
bundle exec rake generate_secret_token
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart
sudo rm /var/www/redmine
sudo ln -s /usr/share/redmine3/public /var/www/redmine
Now try to surf to it. Ooops! Doesn’t work! Why? We need an upgrade to mod_passenger, and we have to build this sucker from source! Hold on to your boostraps…
https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#tarball_generic_install
(I used this tarball, which may differ from the latest when you read this.)
sudo su
mkdir /opt/passenger
cd /opt/passenger
tar xzvf /location-to/passenger-x.x.x.tar.gz
cd /opt/passenger/passenger-x.x.x
./bin/passenger-install-apache2-module
This will guide you through a process that will probably fail, but it will tell you what you need to do to make it work. Best work I’ve ever seen in an open source project! For me, I needed to:
apt-get install libcurl4-openssl-dev
apt-get install libssl-dev
apt-get install apache2-threaded-dev
apt-get install libapr1-dev
apt-get install libaprutil1-dev
Which I combined into one apt-get install libcurl4-openssl-dev libssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev
Let apt-get do its thing and then run the passenger installer again: ./bin/passenger-install-apache2-module
It will be happy and take a VERY long time to compile.
When it’s done, it will tell you modify your apache config with the following lines:
LoadModule passenger_module /opt/passenger/passenger-5.0.6/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /opt/passenger/passenger-5.0.6
PassengerDefaultRuby /usr/bin/ruby1.9.1
</IfModule>
I’ll show you how and where now.
nano /etc/apache2/mods-available/passenger.load
If you already had a version of mod_passenger installed, then this will already contain a mod_passenger line. Comment it out with a # and replace it with LoadModule passenger_module /opt/passenger/passenger-5.0.6/buildout/apache2/mod_passenger.so
nano /etc/apache2/mods-available/passenger.conf
Again, you may need to comment out the existing mod_passenger details and replace it with
<IfModule mod_passenger.c>
PassengerRoot /opt/passenger/passenger-5.0.6
PassengerDefaultRuby /usr/bin/ruby1.9.1
</IfModule>
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart
Surf to your redmine URL and you’re done!

7 thoughts on “Redmine Version 3 onto Raspberry Pi 2”

  1. Hi there. Thanks for the tutorial, helps a lot 🙂

    I did run into an issue, however. Everything worked fine until I went to [rpi]/redmine in my browser. Comparing with the other guide I found this command missing:

    sudo a2ensite redmine

    (in my case it was “sudo a2ensite redmine.conf” but whatever :P)

    After that I ran into Passenger errors. A look in the logs revealed that it can’t access the database – which makes sense because I never provided a username, etc. In your other tutorial this is covered under step 15. But how do I do it for this tutorial because I never got that prompt?

  2. Ok solved it by creating a user + database (if they didn’t exist yet) and edit config/database.yml to reflect those.

    Then I imported a redmine 3.x database I wanted to import anyways (from another server).

    So I guess I missed a step where redmine installs the database?

    1. Thanks for the feedback.
      Frankly, my post is formatted pretty poorly so it would be easy to miss something. I think that process happens in the steps below:

      cp /etc/redmine/default/database.yml /usr/share/redmine3/config/database.yml

      sudo chmod 777 config/database.yml

      sudo chown pi:pi config/database.yml

      nano config/database.yml and change mysql to mysql2

      bundle install –without development test rmagick

  3. Hi,
    i have two Problems. The first with this Line:
    sudo gem install bundler –version ‘1.9.4’
    There is a error:
    Successfully installed bundler-1.12.5
    Parsing documentation for bundler-1.12.5
    Done installing documentation for bundler after 46 seconds
    ERROR: Could not find a valid gem ‘–version’ (>= 0) in any repository
    and then wait te raspi, I can only Interrupt the Process.

    And the second Problem with this line:
    bundle install –without development test rmagick
    With the Error:
    ERROR: “bundle install” was called with arguments [“–without”, “development”, “test”, “rmagick”]
    Usage: “bundle install [OPTIONS]”

    1. Hi Jörg,
      Off the top of my head, I would guess that copy-pasting the ‘–’ character is throwing it off. For those lines, try fully typing out the command instead of copy-paste. And, use double hypens instead of just one. So it will be like this, without any formatting:

      bundle install --without development test rmagick

  4. Thank you for your help.

    But if I at least surf to the redmine url, there is only the list of files and folders.
    The redmine version 2 from your other tutorial runs without problems.

Leave a Reply

Your email address will not be published. Required fields are marked *