Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Redmine Cookbook

You're reading from   Redmine Cookbook Over 80 hands-on recipes to improve your skills in project management, team management, process improvement, and Redmine administration

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher Packt
ISBN-13 9781785286131
Length 322 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Aleksandar Pavic Aleksandar Pavic
Author Profile Icon Aleksandar Pavic
Aleksandar Pavic
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing and Running Redmine 2. Customizing Redmine FREE CHAPTER 3. Project Management with Redmine 4. Improving Team Performance 5. Regular and Planned Maintenance 6. Performance and System Tuning 7. Integrating Redmine with Other Software 8. Getting the Most Out of Scripts and Plugins 9. Troubleshooting 10. Making the Most of Redmine Index

Using custom Ruby for Redmine

While Windows is without a Ruby interpreter and it needs to be manually installed, Linux distributions usually have Ruby in a base package or a web server package. This recipe teaches the user how to install and run Redmine with a custom Ruby interpreter, which can be used if Redmine needs a different Ruby version or if you can't install Ruby system-wide.

Getting ready

First, you need to install Ruby Version Manager (RVM). To use it, you need to have some basic build tools installed on your Linux box. If it's a shared hosting server, most likely these tools are already installed; if they are not, then ask root administrators to install basic build tools or look for another server where you can get sudo or root access.

Preparing for Ubuntu servers

Log in to your server and run the following command:

curl -SSL https://rvm.io/mpapis.asc | gpg --import -

Open your .gemrc file and add the following:

gem: --no-rdoc --no-ri

You can do this with nano:

nano ~/.gemrc

If curl is not installed or available for some reason, you can download a curl binary from http://curl.haxx.se/download.html and execute the same command just by adding ./ in front of it.

If the Ubuntu server is freshly installed, you are probably going to need some basic build tools such as make. To install them, type: sudo apt-get install build-essential.

Preparing for Cent OS servers

For Cent OS, you don't need to import repository keys, but you probably need to install development tools that are required to compile some gems. To install prerequisites, run the following command:

yum groupinstall -y development

RVM installation

Once we have performed the necessary preparation steps, we start by downloading and installing RVM with this command:

curl -L get.rvm.io | bash -s stable

This will install the latest stable version of RVM; to start using it, type:

source ~/.rvm/scripts/rvm

After this command you can check which version of RVM is installed by typing the following:

rvm -v

How to do it…

Once we have installed RVM, we use it to install the required Ruby version.

First, we ensure RVM is working properly after installation by typing the following:

rvm reload

Then, we install a custom Ruby version; at the time of writing this book it is 2.2.1, which is supported by Redmine 3.X versions:

rvm install ruby-head

Then, we proceed with the Redmine installation, as explained in the recipe, Installing from a source on Ubuntu.

After this, running Redmine with Passenger, you need to add the following line to your virtual server's configuration:

PassengerRuby /home/your_user/.rvm/gems/ruby-2.1.0/wrappers/ruby

Replace your_user and the Ruby version with your actual username; text after PassengerRuby is actually an output of the following command:

which ruby

After this, reload Apache. If you are on a shared hosting, Apache probably reloads automatically once your server's virtual configuration is edited; if you have root access, you need to reload it manually.

Redmine should now work, if it's not working or throwing some errors, try looking at Chapter 9, Troubleshooting.

How it works…

First, we installed Ruby Version Manager (RVM) and its required prerequisites, which is usually a set of basic build tools that are required to compile some binary packages on Linux systems. Then, we used RVM to install a custom version of Ruby. RVM lets users have multiple Ruby versions on the system and switch to the default Ruby among them. However, most users are probably going to need only one custom Ruby version available in their home directory, which is going to be used by Redmine. Once Ruby was installed, we proceeded with the Redmine installation from the source by following the recipe Installing from a source on Ubuntu. Then, we configured Phusion Passenger and Apache by following the recipe Running Redmine with Phusion Passenger but with one variation: we needed to tell Phusion Passenger which Ruby version to use to run Redmine installed in our custom home directory.

There's more…

You can experiment with different RVM and Ruby versions and have multiple Redmines installed on the same server by following this recipe. This can also be used to upgrade Redmine without ruining your server if you need the system Ruby version to be used by some other applications. In this case, create a new user, install Redmine under this user's home directory, and migrate data from your old installation. Or just copy the whole directory and perform an upgrade also by upgrading the old database.

See also

If you need to use a different version of RVM for some reason, follow the tutorials available on RVM's website: https://rvm.io/rvm/install.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image