Book Image

Redmine Cookbook

By : Shamasis Bhattacharya
Book Image

Redmine Cookbook

By: Shamasis Bhattacharya

Overview of this book

In a variety of online project management tools, Redmine markets itself as offering flexibility. Choosing the right management tool can mean the difference between the success and failure of a project. Flexible project management tools bend themselves to fit your needs, whether that’s communication regarding a simple project, or collaboration, or more complex project methodology such as SCRUM, or an issue-code relationship, or the need of different methodology for your project. Whether you are project manager or system administrator, this book provides valuable recipes to get the best possible performance out of your team, organization, infrastructure, and Redmine itself. Through a series of carefully crafted recipes covering the nitty-gritty of Redmine, you’ll be guided through the installation of Redmine, as well as how to fine-tune and customize your Redmine installation. Finally, we walk you through integrating Redmine with other softwares and databases like Tortoise SVN and Visual Studio and troubleshooting Redmine.
Table of Contents (17 chapters)
Redmine Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
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.