Difference between revisions of "Redmine"

From ArchWiki
Jump to: navigation, search
m (RMagick gem without support for High Dynamic Range in ImageMagick)
(flagged broken section links (interactive))
(Tag: wiki-scripts)
 
(67 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
[[Category:Version Control System]]
 
[[Category:Version Control System]]
{{Article summary start}}
+
[[ja:Redmine]]
{{Article summary text|This page gives guidelines for the installation and configuration of Redmine on Archlinux.}}
+
{{Related articles start}}
{{Article summary heading|Related}}
+
{{Related|Ruby on Rails}}
{{Article summary wiki|Ruby on Rails}}
+
{{Related|RVM}}
{{Article summary wiki|RVM}}
+
{{Related|MariaDB}}
{{Article summary wiki|MariaDB}}
+
{{Related|Apache}}
{{Article summary end}}
+
{{Related|Nginx}}
 +
{{Related articles end}}
 +
'''Redmine''' is a [[Wikipedia:free and open source software|free and open source]], web-based [[Wikipedia:project management|project management]] and [[Wikipedia:Issue tracking system|issue tracking]] tool. It handles multiple projects and subprojects.  It [http://www.redmine.org/projects/redmine/wiki/Features features] per project wikis and forums, time tracking, and flexible role based access control. It includes a [[Wikipedia:calendar|calendar]] and [[Wikipedia:Gantt chart|Gantt chart]]s to aid visual representation of projects and their [[Wikipedia:time limit|deadlines]]. Redmine integrates with various [[Wikipedia:version control|version control]] systems and includes a repository browser and diff viewer.
  
Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.
+
Redmine is written using the [[Ruby on Rails]] framework. It is cross-platform and cross-[[Wikipedia:database|database]] and supports 34 languages.
 
+
Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database.
+
  
 
==Prerequisites==
 
==Prerequisites==
  
This document will guide you through the installation process of the Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and it's prerequisites separately, simply refering to the relevant sections below.
+
This document will guide you through the installation process of Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and its prerequisites separately, simply referring to the relevant sections below.
  
Although this guide will go through all the installation process, this isn't a one way path. So Redmine can use different versions of the other softwares (mariaDB, mySQL, postgreSQL, etc, as your database).
+
Although this guide will go through the entire installation process, this is not a one way path. Redmine can use different versions of the requisite software.  For example the database requirement can be provided by mariaDB, mySQL, postgreSQL, etc.
  
{{Note|At this time is important to note that this guide is an default suggestion, feel free to use other of the prerequisites mentioned on this wiki.}}
+
{{Note|This guide is a default suggestion, feel free to substitute any of the prerequisites mentioned on this page.}}
  
 
===Ruby===
 
===Ruby===
  
<table border="1">
+
{| border="1" class="wikitable" style="text-align:center;"
<tr>
+
! Redmine version
<th>Redmine version</th>
+
! Supported Ruby Versions
<th>Supported Ruby versions</th>
+
! Rails version used
<th>Rails version used</th>
+
|-
<th>Supported RubyGems versions</th>
+
! 3.0.2
</tr>
+
| style="text-align:left;" | '''ruby''' 1.9.3<sup>3</sup>, 2.0.0<sup>2</sup>, 2.1, 2.2<sup>1</sup>
<tr>
+
| '''Rails''' 4.2<sup>0</sup>
<td rowspan="2">2.3.3</td>
+
|}
<td>ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0</td>
+
<td rowspan="2">Rails 3.2.13</td>
+
<td rowspan="2">RubyGems <= 1.8</td>
+
</tr>
+
<tr>
+
<td>jruby 1.6.7, 1.7.2</td>
+
</tr>
+
</table>
+
  
 
There are two simple ways to install Ruby: installing the {{Pkg|ruby}} package as described in [[ruby]] or installing RVM as described in [[RVM]] '''(recommended)'''.
 
There are two simple ways to install Ruby: installing the {{Pkg|ruby}} package as described in [[ruby]] or installing RVM as described in [[RVM]] '''(recommended)'''.
  
{{Note|Ruby MRI 1.8.7 support has reached its EOL and its use is discouraged. See [http://www.redmine.org/boards/1/topics/38518 Important: Ruby 1.8.7 out of support] and [http://www.redmine.org/issues/14371 #14371] for additional information.}}
 
  
{{Note|If you use RVM, pay attention to the single and multiple user differences! If you are not creating a hosting service, the multiple user (available for all users on the machine) should be the choice for simpler debuging.}}
+
{{Note | <sup>0</sup> Rails 4.2.1 has non ASCII URL issue on MinGW Ruby ([http://rubyinstaller.org/ Windows-based installer]) thin and puma ([http://www.redmine.org/issues/19321 #19321], [http://www.redmine.org/issues/19374 #19374]) }}
 +
{{Note | <sup>1</sup> MinGW Ruby 2.2 has nokogiri issue ([http://www.redmine.org/issues/19419 #19419]).}}
 +
{{Note | <sup>2</sup> As of 2013-03-19, SQL Server support is reported broken with '''ruby 2.0.0 under Windows''' because of a [https://github.com/rails-sqlserver/tiny_tds/issues/110 database adapter gem incompatibility]}}
 +
{{Note | <sup>3</sup> MRI 1.9.3p327 contains a [http://bugs.ruby-lang.org/issues/7374 bug] breaking plugin loading under Windows which 1.9.3p194 or 1.9.3p392 haven't.}}
 +
{{Warning|If you use RVM, pay attention to the single and multiple user differences! If you are not creating a hosting service, the multiple user (available for all users on the machine) should be the choice for simpler debuging.}}
  
 
===Database===
 
===Database===
Line 51: Line 46:
  
 
====MariaDB 5.0 or higher (recommended)====
 
====MariaDB 5.0 or higher (recommended)====
MariaDB is a drop-in replacement for MySQL, in fact it was a fork of it and maintain binarie compatibility.
+
MariaDB is a drop-in replacement for MySQL, in fact it was a fork of it and maintain binary compatibility. It is also [https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ Arch Linux's default implementation of MySQL].
  
To install {{Pkg|mariadb}} simply refer to [[MariaDB]].
+
To install {{Pkg|mariadb}} simply refer to [[MySQL]].
  
 
====MySQL 5.0 or higher====
 
====MySQL 5.0 or higher====
To install {{Pkg|mysql}} simply refer to [[MySQL]].
+
[https://www.archlinux.org/news/mariadb-replaces-mysql-in-repositories/ Oracle MySQL was dropped] to the [[AUR]].
 +
 
 +
{{AUR|mysql}} in the [[AUR]].
  
 
====PostgreSQL 8.2 or higher====
 
====PostgreSQL 8.2 or higher====
To install {{Pkg|postgresql}} simply refer to [[Postgresql]].
+
To install {{Pkg|postgresql}} simply refer to [[PostgreSQL]].
  
 
Make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using:
 
Make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using:
Line 65: Line 62:
 
{{bc|1=ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";}}
 
{{bc|1=ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";}}
  
{{Note|Some bugs in PostgreSQL 8.4.0 and 8.4.1 affect Redmine behavior ([[http://www.redmine.org/issues/4259 #4259]], [[http://www.redmine.org/issues/4314 #4314]]), they are fixed in PostgreSQL 8.4.2}}
+
{{Note|Some bugs in PostgreSQL 8.4.0 and 8.4.1 affect Redmine behavior ([http://www.redmine.org/issues/4259 #4259], [http://www.redmine.org/issues/4314 #4314]), they are fixed in PostgreSQL 8.4.2}}
  
 
====Microsoft SQL Server====
 
====Microsoft SQL Server====
Line 72: Line 69:
 
====SQLite 3====
 
====SQLite 3====
 
Not supported for multi-user production use. So, it will not be detailed how to install and configure it for use with Redmine. See [http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Supported-database-back-ends upstream document] for more info.
 
Not supported for multi-user production use. So, it will not be detailed how to install and configure it for use with Redmine. See [http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Supported-database-back-ends upstream document] for more info.
 
{{Warning|Support is temporarily broken (with ruby 2.0.0 under Windows because of database adapter gems incompatibilities).}}
 
  
 
===Web Server===
 
===Web Server===
 
====Phusion Passenger (recommended)====
 
 
TODO
 
  
 
====Apache====
 
====Apache====
 
+
To install {{Pkg|apache}} simply refer to [[Apache]].
TODO
+
  
 
====Mongrel====
 
====Mongrel====
 
+
To install Mongrel server (ruby gem) simply refer to [[Ruby on Rails#Mongrel]]{{Broken section link}}{{Dead link|2015|02|05}}.
TODO
+
  
 
==== Unicorn ====
 
==== Unicorn ====
Configure and start Unicorn using script provided in [[Ruby on Rails#Unicorn]].
+
To install Unicorn server (ruby gem) simply refer to [[Ruby on Rails#Unicorn]].
  
====nginx====
+
====Nginx====
 
+
To install {{Pkg|nginx}} simply refer to [[Nginx]].
See [[Nginx]] to install it.
+
  
 
====Apache Tomcat====
 
====Apache Tomcat====
 
+
To install {{Pkg|tomcat6}} or {{Pkg|tomcat7}} simply refer to [[Tomcat]].
See [[Ruby on Rails#Application_servers]]
+
  
 
==Optional Prerequisites==
 
==Optional Prerequisites==
Line 104: Line 91:
 
===SCM (Source Code Management)===
 
===SCM (Source Code Management)===
  
TODO: list all scm supported and how to install them...
+
<table border="1">
 +
<tr>
 +
<th>SCM</th>
 +
<th>Supported versions</th>
 +
<th>Comments</th>
 +
</tr>
 +
<tr>
 +
<td>[http://git-scm.com Git]</td>
 +
<td>>=1.5.4.2</td>
 +
<td></td>
 +
</tr>
 +
<tr>
 +
<td>[http://subversion.apache.org Subversion]</td>
 +
<td>1.3, 1.4, 1.5, 1.6 & 1.7</td>
 +
<td>1.3 or higher required.<br/>
 +
Does not support Ruby Bindings for Subversion.<br/>
 +
Subversion 1.7.0 and 1.7.1 contains bugs [http://www.redmine.org/issues/9541 #9541]</td>
 +
</tr>
 +
<tr>
 +
<td>[http://www.selenic.com/mercurial Mercurial]</td>
 +
<td>>=1.6</td>
 +
<td>Support bellow version 1.6 is droped as seen in [http://www.redmine.org/issues/9465 #9465].</td>
 +
</tr>
 +
<tr>
 +
<td>[http://bazaar-vcs.org Bazaar]</td>
 +
<td>>= 2.0.4</td>
 +
<td></td>
 +
</tr>
 +
<tr>
 +
<td>[http://darcs.net Darcs]</td>
 +
<td>>=1.0.7</td>
 +
<td></td>
 +
</tr>
 +
<tr>
 +
<td>[http://www.nongnu.org/cvs CVS]</td>
 +
<td>1.12.12</td>
 +
<td>1.12 required.<br/>
 +
Will not work with CVSNT.</td>
 +
</tr>
 +
</table>
 +
 
 +
More information can be read at [http://www.redmine.org/projects/redmine/wiki/RedmineRepositories Redmine Repositories Wiki].
 +
 
 +
===ImageMagick (recommended)===
 +
[http://www.imagemagick.org ImageMagick] is necessary to enable Gantt export to a [[wikipedia:Portable_Network_Graphics|PNG]] file.
  
===ImageMagick===
+
To install {{pkg|imagemagick}} simply:
TODO: to enable Gantt export to png image.
+
# pacman -S imagemagick
link: http://www.imagemagick.org/
+
  
 
===Ruby OpenID Library===
 
===Ruby OpenID Library===
TODO: to enable OpenID support (version 2 or greater is required).
+
To enable [http://janrain.com/openid-enabled OpenID] support, is required a version >= 2 of the library.
link: http://openidenabled.com/ruby-openid/
+
  
 
==Installation==
 
==Installation==
  
 
===Build and Installation===
 
===Build and Installation===
Download the package {{AUR|redmine}} from the [[Arch User Repository|AUR]].
+
Download, build and install the {{AUR|redmine}} package from the [[AUR]].
  
{{Note|Detailed build instructions at [[Arch User Repository#Build the package]]. It's '''HIGHLY''' recommended to read all the [[Arch User Repository|AUR]] page to understand what are you doing. }}
+
{{Note|Detailed build instructions are in [[Arch User Repository#Build the package|Build the package]]{{Broken section link}}. It is '''HIGHLY''' recommended to read the [[AUR]] page to understand what are you doing. }}
  
 
===Database Configuration===
 
===Database Configuration===
Line 212: Line 241:
  
 
=== Ruby gems ===
 
=== Ruby gems ===
Redmine requires some [https://wiki.archlinux.org/index.php/Ruby#RubyGems RubyGems] to be installed and there are multiple ways of installing them (as listed on the referenced page).
+
Redmine requires some [[Ruby#RubyGems|RubyGems]] to be installed and there are multiple ways of installing them (as listed on the referenced page).
 
* prototype-rails
 
* prototype-rails
 
* unicorn (an application-server)
 
* unicorn (an application-server)
Line 252: Line 281:
 
{{Note|You can include/exclude environments using the above syntax.}}
 
{{Note|You can include/exclude environments using the above syntax.}}
  
Although it is highly recommend to enjoy all the features of Redmine, if you really does not want to use {{Pkg|ImageMagick}}, you should skip the installation of the {{ic|rmagick}} gem using:
+
Although {{Pkg|imagemagick}} is highly [[#ImageMagick_.28recommended.29|recommended]], if you do not use it, you should skip the installation of the {{ic|rmagick}} gem using:
  
 
  # bundle install --without rmagick
 
  # bundle install --without rmagick
  
{{Note|Only the gems that are needed by the adapters you've specified in your database configuration file are actually installed (eg. if your {{ic|config/database.yml}} uses the ''mysql2'' adapter, then only the mysql2 gem will be installed). Don't forget to re-run {{ic|bundle install}} when you change or add adapters in this file.}}
+
{{Note|Only the gems that are needed by the adapters you have specified in your database configuration file are actually installed (eg. if your {{ic|config/database.yml}} uses the ''mysql2'' adapter, then only the mysql2 gem will be installed). Do not forget to re-run {{ic|bundle install}} when you change or add adapters in this file.}}
  
 
===Session Store Secret Generation===
 
===Session Store Secret Generation===
 
Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:
 
Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:
  
  # rake generate_secret_token
+
  # bundle exec rake generate_secret_token
  
{{Note|For Redmine prior to 2.x this step is done by executing {{ic|# rake generate_session_store}}.}}
+
{{Note|For Redmine prior to 2.x this step is done by executing {{ic|# bundle exec rake generate_session_store}}.}}
  
 
{{Warning|Generating a new secret token invalidates all existing sessions after restart.}}
 
{{Warning|Generating a new secret token invalidates all existing sessions after restart.}}
  
 
===Database Structure Creation===
 
===Database Structure Creation===
With the database created and the access configured for Redmine, now it's time to create the database structure. This is done by running the following command under the application root directory:
+
With the database created and the access configured for Redmine, now it is time to create the database structure. This is done by running the following command under the application root directory:
  
 
  # cd /usr/share/webapps/redmine
 
  # cd /usr/share/webapps/redmine
  # RAILS_ENV=production rake db:migrate
+
  # RAILS_ENV=production bundle exec rake db:migrate
  
 
These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.
 
These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.
Line 278: Line 307:
 
Now you may want to insert the default configuration data in database, like basic types of  task, task states, groups, etc. To do so execute the following:
 
Now you may want to insert the default configuration data in database, like basic types of  task, task states, groups, etc. To do so execute the following:
  
  # RAILS_ENV=production rake redmine:load_default_data
+
  # RAILS_ENV=production bundle exec rake redmine:load_default_data
  
 
Redmine will prompt for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task:
 
Redmine will prompt for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task:
  
  # RAILS_ENV=production REDMINE_LANG=pt-BR rake redmine:load_default_data
+
  # RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake redmine:load_default_data
  
 
{{Note|This step is not mandatory, but it certainly will save you a lot of work to start using Redmine. And for a first time it can be very instructive.}}
 
{{Note|This step is not mandatory, but it certainly will save you a lot of work to start using Redmine. And for a first time it can be very instructive.}}
Line 302: Line 331:
 
To test your new installation using WEBrick web server run the following in the Redmine folder:
 
To test your new installation using WEBrick web server run the following in the Redmine folder:
  
  # ruby script/rails server webrick -e production
+
  # ruby bin/rails server webrick -e production
  
 
Once WEBrick has started, point your browser to '''http://localhost:3000/'''. You should now see the application welcome page. Use default administrator account to log in: '''''admin'''''/'''''admin'''''. You can go to Administration menu and choose Settings to modify most of the application settings.
 
Once WEBrick has started, point your browser to '''http://localhost:3000/'''. You should now see the application welcome page. Use default administrator account to log in: '''''admin'''''/'''''admin'''''. You can go to Administration menu and choose Settings to modify most of the application settings.
  
 
{{Warning|Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.}}
 
{{Warning|Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.}}
 +
 +
===Configure the production server===
 +
For Apache and Nginx, it is recommended to use Phusion Passenger. [http://www.modrails.com/ Passenger], also known as {{ic|mod_rails}}, is a module available for [[Nginx]] and [[Apache]].
 +
 +
Start by installing the 'passenger' gem:
 +
# gem install passenger
 +
 +
Now you have to look at your passenger gem installation directory to continue. If you do not known where it is, type:
 +
# gem env
 +
 +
And look at the {{ic|GEM PATHS}} to find where the gems are installed. If you followed this guide and installed [[RVM]], you can have more than one path, look at the one you are using.
 +
 +
For this guide so far, the gem path is {{ic|/usr/local/rvm/gems/ruby-2.0.0-p247@global}}.
 +
# cd /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/passenger-4.0.23
 +
 +
If you are aiming to use [[Apache]], run:
 +
# passenger-install-apache2-module
 +
 +
In case a rails application is deployed with a sub-URI, like http://example.com/yourapplication, some additional configuration is required, see [http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri the modrails documentation]
 +
 +
For [[Nginx]]:
 +
# passenger-install-nginx-module
 +
 +
And finally, the installer will provide you with further information regarding the installation (such as installing additional libraries). So, to setup your server, simply follow the output from the passenger installer.
  
 
==Updating==
 
==Updating==
Line 328: Line 381:
 
  # pacman -U redmine-2.3.0-2-any.pkg.tar.gz
 
  # pacman -U redmine-2.3.0-2-any.pkg.tar.gz
  
{{Note|To simplify all this [[AUR]] install and update process, you can always use the [[AUR Helpers]], although this isn't a supported way.}}
+
{{Note|To simplify all this [[AUR]] install and update process, you can always use the [[AUR helpers]], although this is not a supported way.}}
  
 
Update the gems requirements:
 
Update the gems requirements:
Line 341: Line 394:
 
  # gem install bundler
 
  # gem install bundler
 
  # bundle install --without development test
 
  # bundle install --without development test
 +
 +
{{Note|If you removed ALL the gems as above, and used a server that uses a gem, remember to reinstall the server gem: passenger (for Apache and Nginx), Mongrel or Unicorn. To do this, just follow the steps in the installation tutorial above.}}
  
 
Copy the saved files:
 
Copy the saved files:
Line 350: Line 405:
 
Regenerate the secret token:
 
Regenerate the secret token:
 
  # cd /usr/share/webapps/redmine
 
  # cd /usr/share/webapps/redmine
  # rake generate_secret_token
+
  # bundle exec rake generate_secret_token
  
 
Check for any themes that you may have installed in the {{ic|public/themes}} directory. You can copy them over but checking for updated version is ideal.
 
Check for any themes that you may have installed in the {{ic|public/themes}} directory. You can copy them over but checking for updated version is ideal.
Line 357: Line 412:
  
 
Update the database. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:
 
Update the database. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:
  # RAILS_ENV=production REDMINE_LANG=pt-BR rake db:migrate
+
  # RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake db:migrate
  
 
If you have installed any plugins, you should also run their database migrations:
 
If you have installed any plugins, you should also run their database migrations:
  # RAILS_ENV=production REDMINE_LANG=pt-BR rake redmine:plugins:migrate
+
  # RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake redmine:plugins:migrate
  
Now, it's time to clean the cache and the existing sessions:
+
Now, it is time to clean the cache and the existing sessions:
  # rake tmp:cache:clear
+
  # RAILS_ENV=production bundle exec rake tmp:cache:clear tmp:sessions:clear
# rake tmp:sessions:clear
+
  
 
Restart the application server (e.g. puma, thin, passenger, etc). And finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any.
 
Restart the application server (e.g. puma, thin, passenger, etc). And finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any.
 +
 +
==Troubleshooting==
 +
===RMagick gem without support for High Dynamic Range in ImageMagick===
 +
As of ImageMagick 6.8.6.8-1, it is built with HDRI (High Dynamic Range Image) support, and this breaks the RMagick gem as seen in {{Bug|36518}}.
 +
 +
The github [https://github.com/rmagick/rmagick rmagick] is already patched, but the mantainer did not packed it for rubygems yet.
 +
 +
To install this patched version download the git repository:
 +
# git clone https://github.com/rmagick/rmagick.git
 +
 +
Then, you need to build the gem:
 +
# cd rmagick
 +
# gem build rmagick.gemspec
 +
 +
And finally install it:
 +
# gem install rmagick-2.13.2.gem
 +
 +
{{Note|It will show some complains like {{ic|unable to convert "\xE0" from ASCII-8BIT to UTF-8 for ext/RMagick/RMagick2.so, skipping}}, but you can safelly ignore it.}}
 +
 +
===Runtime error complaining that RMagick was configured with older version===
 +
 +
If you get the following runtime error after upgrading ImageMagick {{ic|This installation of RMagick was configured with ImageMagick 6.8.7 but ImageMagick 6.8.8-1 is in use.}} then you only need to reinstall (or rebuild as shown above if is the case).
 +
 +
{{Note|This is due to that when you install the RMagick gem it compiles some native extensions and they may need to be rebuilt after some ImageMagick upgrades.}}
 +
 +
=== OpenSSL error about "SSLv3_client" ===
 +
 +
After thel latest OpenSSL release (version 1.0.2.g-3) the ruby stop to work and you cannot build some ruby versions. You have two way to fix it:
 +
 +
1. Use ruby-head (if using RVM) or 2.3.0or above (if using arhc package).
 +
 +
2. Use this patch as noted in [https://github.com/rvm/rvm/issues/3529#issuecomment-157205030 Issue 3529] and [https://github.com/rvm/rvm/issues/3548 Issue 3548]
 +
 +
# curl https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff > openssl.patch
 +
# rvm install --patch ./openssl.patch 2.0.0 /*or another ruby version*/
 +
 +
===Error when installing gems: Cannot load such file -- mysql2/mysql2===
 +
 +
If you see an error like {{ic| cannot load such file -- mysql2/mysql2}}, you are having a problem with the installation of the database gem. Probably a misconfiguration in the [[#Database Access Configuration|Database Access Configuration]] step.
 +
In this case you should verify the {{ic|database.yml}} file.
 +
 +
If no success, you can manually install the database gem by:
 +
 +
# gem install mysql2
 +
 +
In last case, as suggested by [[User:Bobdog|Bobdog]], you can try to comment the line of the database gem and add a new one as bellow:
 +
 +
{{hc|<path-to-mysql2-gem-directory>/lib/mysql2/mysql2.rb|
 +
 +
# require 'mysql2/mysql2'
 +
require '<path-to-mysql2-gem-directory>/lib/mysql2/mysql2.so'}}
 +
 +
=== Apache 2.4 Updating ===
 +
 +
When updating to Apache 2.4 will be necessary to remove and install all your gems to make sure all of them that need to build native extensions will be rebuilt against the new Apache server.
 +
 +
So, for a clean gems environment, remove all the gems:
 +
 +
# for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done
 +
 +
To reinstall the gems:
 +
 +
# cd /usr/share/webapps/redmine
 +
# gem install bundler
 +
# bundle install --without development test
 +
 +
Remember to reinstall the RMagick gem as describe above in [[#RMagick gem without support for High Dynamic Range in ImageMagick|RMagick gem without support for High Dynamic Range in ImageMagick]].
 +
 +
And if you are using Passenger to serve your apps through Apache you will need to reinstall it as described above in [[#Configure the production server|Configure the production server]].
  
 
=== Checkout SVN Source ===
 
=== Checkout SVN Source ===
Line 375: Line 498:
 
  # chown -R redmine: /srv/http/redmine
 
  # chown -R redmine: /srv/http/redmine
  
 +
=== Automating The Update Process ===
 +
Example of an after-update script:
  
==Test server==
+
#!/usr/bin/bash
 +
export RAILS_ENV=production
 +
grep -E "^gem 'thin'" Gemfile || echo "gem 'thin'" >> Gemfile
 +
bundle update && bundle exec rake generate_secret_token db:migrate redmine:plugins:migrate tmp:cache:clear tmp:sessions:clear
  
===Unicorn server===
+
{{Note| Note that this script uses Thin as application server, so you must change it to your needs.}}
  
# sudo -u redmine2 unicorn -D -E production -c config/unicorn.rb
+
=== Creating a Systemd Unit===
 +
If you want to automatic run you application server when system starts, you need to create a systemd unit file.
  
 +
{{Note| This is not needed if you use {{Pkg|apache}} or {{Pkg|nginx}} with Passenger gem. Those servers already have their own unit file, so you have only to enable it.}}
  
==Troubleshooting==
+
{{hc|/etc/systemd/system/redmine.service|<nowiki>
===RMagick gem without support for High Dynamic Range in ImageMagick===
+
[Unit]
As of ImageMagick 6.8.6.8-1, it is built with HDRI (High Dynamic Range) support, and this breaks the RMagick gem as seen in [https://bugs.archlinux.org/task/36518 Arch bug #36518].
+
Description=Redmine server
 +
After=syslog.target
 +
After=network.target
  
The github [https://github.com/rmagick/rmagick rmagick] is already patched, but the mantainer did not packed it for rubygems yet.
+
[Service]
 +
Type=simple
 +
User=redmine2
 +
Group=redmine2
 +
Environment=GEM_HOME=/home/redmine2/.gem/
 +
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production
  
To install this patched version download the git repository:
+
# Give a reasonable amount of time for the server to start up/shut down
# git clone https://github.com/rmagick/rmagick.git
+
TimeoutSec=300
  
Then, you need to build the gem:
+
[Install]
# cd rmagick
+
WantedBy=multi-user.target
# gem build rmagick.gemspec
+
  
And finally install it:
+
</nowiki>}}
# gem install rmagick-2.13.2.gem
+
  
{{Note|It will show some complains like {{ic|unable to convert "\xE0" from ASCII-8BIT to UTF-8 for ext/RMagick/RMagick2.so, skipping}}, but you can safelly ignore it.}}
+
=== Complaints about psych===
 +
 
 +
Like that:
 +
 
 +
/usr/lib/ruby/2.1.0/psych/parser.rb:33:in `<class:Parser>': superclass mismatch for class Mark (TypeError)
 +
from /usr/lib/ruby/2.1.0/psych/parser.rb:32:in `<module:Psych>'
 +
from /usr/lib/ruby/2.1.0/psych/parser.rb:1:in `<top (required)>'
 +
from /usr/lib/ruby/2.1.0/psych.rb:7:in `require'
 +
 
 +
[http://www.redmine.org/boards/2/topics/36728 according to that] that is a bundler issue, and you have to add
 +
gem 'psych'
 +
to your Gemfile.local
 +
 
 +
== See also ==
  
== See Also ==
+
* [http://www.redmine.org/ Redmine Official Site]
 +
* [http://www.redmine.org/projects/redmine/wiki/Features Redmine Features]
 
* [http://www.redmine.org/projects/redmine/wiki/RedmineInstall  Official install guide from Redmine Wiki]
 
* [http://www.redmine.org/projects/redmine/wiki/RedmineInstall  Official install guide from Redmine Wiki]

Latest revision as of 10:52, 7 August 2016

Redmine is a free and open source, web-based project management and issue tracking tool. It handles multiple projects and subprojects. It features per project wikis and forums, time tracking, and flexible role based access control. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. Redmine integrates with various version control systems and includes a repository browser and diff viewer.

Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database and supports 34 languages.

Prerequisites

This document will guide you through the installation process of Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and its prerequisites separately, simply referring to the relevant sections below.

Although this guide will go through the entire installation process, this is not a one way path. Redmine can use different versions of the requisite software. For example the database requirement can be provided by mariaDB, mySQL, postgreSQL, etc.

Note: This guide is a default suggestion, feel free to substitute any of the prerequisites mentioned on this page.

Ruby

Redmine version Supported Ruby Versions Rails version used
3.0.2 ruby 1.9.33, 2.0.02, 2.1, 2.21 Rails 4.20

There are two simple ways to install Ruby: installing the ruby package as described in ruby or installing RVM as described in RVM (recommended).


Note: 0 Rails 4.2.1 has non ASCII URL issue on MinGW Ruby (Windows-based installer) thin and puma (#19321, #19374)
Note: 1 MinGW Ruby 2.2 has nokogiri issue (#19419).
Note: 2 As of 2013-03-19, SQL Server support is reported broken with ruby 2.0.0 under Windows because of a database adapter gem incompatibility
Note: 3 MRI 1.9.3p327 contains a bug breaking plugin loading under Windows which 1.9.3p194 or 1.9.3p392 haven't.
Warning: If you use RVM, pay attention to the single and multiple user differences! If you are not creating a hosting service, the multiple user (available for all users on the machine) should be the choice for simpler debuging.

Database

Redmine supports many different databases.

MariaDB 5.0 or higher (recommended)

MariaDB is a drop-in replacement for MySQL, in fact it was a fork of it and maintain binary compatibility. It is also Arch Linux's default implementation of MySQL.

To install mariadb simply refer to MySQL.

MySQL 5.0 or higher

Oracle MySQL was dropped to the AUR.

mysqlAUR in the AUR.

PostgreSQL 8.2 or higher

To install postgresql simply refer to PostgreSQL.

Make sure your database datestyle is set to ISO (Postgresql default setting). You can set it using:

ALTER DATABASE "redmine_db" SET datestyle="ISO,MDY";
Note: Some bugs in PostgreSQL 8.4.0 and 8.4.1 affect Redmine behavior (#4259, #4314), they are fixed in PostgreSQL 8.4.2

Microsoft SQL Server

Warning: Support is temporarily broken (with ruby 2.0.0 under Windows because of database adapter gem incompatibility).

SQLite 3

Not supported for multi-user production use. So, it will not be detailed how to install and configure it for use with Redmine. See upstream document for more info.

Web Server

Apache

To install apache simply refer to Apache.

Mongrel

To install Mongrel server (ruby gem) simply refer to Ruby on Rails#Mongrel[broken link: invalid section][dead link 2015-02-05].

Unicorn

To install Unicorn server (ruby gem) simply refer to Ruby on Rails#Unicorn.

Nginx

To install nginx simply refer to Nginx.

Apache Tomcat

To install tomcat6 or tomcat7 simply refer to Tomcat.

Optional Prerequisites

SCM (Source Code Management)

SCM Supported versions Comments
Git >=1.5.4.2
Subversion 1.3, 1.4, 1.5, 1.6 & 1.7 1.3 or higher required.

Does not support Ruby Bindings for Subversion.

Subversion 1.7.0 and 1.7.1 contains bugs #9541
Mercurial >=1.6 Support bellow version 1.6 is droped as seen in #9465.
Bazaar >= 2.0.4
Darcs >=1.0.7
CVS 1.12.12 1.12 required.
Will not work with CVSNT.

More information can be read at Redmine Repositories Wiki.

ImageMagick (recommended)

ImageMagick is necessary to enable Gantt export to a PNG file.

To install imagemagick simply:

# pacman -S imagemagick

Ruby OpenID Library

To enable OpenID support, is required a version >= 2 of the library.

Installation

Build and Installation

Download, build and install the redmineAUR package from the AUR.

Note: Detailed build instructions are in Build the package[broken link: invalid section]. It is HIGHLY recommended to read the AUR page to understand what are you doing.

Database Configuration

Now, we will need to create the database that the Redmine will use to store your data. For now on, the database and its user will be named redmine. But this names can be changed to anything else.

Note: The configuration for MariaDB and MySQL will be the same since both are binary compatible.

Database Creation

To create the database, the user and set privileges (MariaDB and MySQL >= 5.0.2):

# mysql -u root -p
CREATE DATABASE redmine CHARACTER SET UTF8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';

For versions of MariaDB and MySQL prior to 5.0.2:

# mysql -u root -p
CREATE DATABASE redmine CHARACTER SET UTF8;
GRANT ALL PRIVILEGES ON redmine.* TO'redmine'@'localhost' IDENTIFIED BY 'my_password';

For PostgreSQL:

CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity';
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;

For SQLServer:

Although the database, login and user can be created within SQL Server Management Studio with a few clicks, you can always use the command line with SQLCMD:

USE [master]
GO
-- Very basic DB creation
CREATE DATABASE [REDMINE]
GO
-- Creation of a login with SQL Server login/password authentication and no password expiration policy
CREATE LOGIN [REDMINE] WITH PASSWORD=N'redminepassword', DEFAULT_DATABASE=[REDMINE], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
-- User creation using previously created login authentication
USE [REDMINE]
GO
CREATE USER [REDMINE] FOR LOGIN [REDMINE]
GO
-- User permissions set via roles
EXEC sp_addrolemember N'db_datareader', N'REDMINE'
GO
EXEC sp_addrolemember N'db_datawriter', N'REDMINE'
GO
Note: If you want to use additional environments, you must create separate databases for each one (for example: development and test).

Database Access Configuration

Now you need to configure Redmine to access the database we just created. To do that you have to copy /usr/share/webapps/redmine/config/database.yml.example to database.yml:

# cd /usr/share/webapps/redmine/config
# cp database.yml.example database.yml

And then edit this file in order to configure your database settings for "production" environment (you can configure for the "development" and "test" environments too, just change the appropriate sections).

Example for MariaDB and MySQL database:

nano database.yml
production:
  adapter: mysql2
  database: redmine
  host: localhost
  port: 3307   #If your server is not running on the standard port (3306), set it here, otherwise this line is unnecessary.
  username: redmine
  password: my_password
Note: For ruby1.9 the "adapter" value must be set to mysql2, and for ruby1.8 or jruby, it must be set to mysql.

Example for PostgreSQL database:

nano database.yml
production:
  adapter: postgresql
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8
  schema_search_path: <database_schema> (default - public)

Example for a SQL Server database:

nano database.yml
production:
  adapter: sqlserver
  database: redmine
  host: localhost #Set not default host (localhost) here, otherwise this line is unnecessary.
  port: 1433 #Set not standard port (1433) here, otherwise this line is unnecessary.
  username: redmine
  password: my_password

Ruby gems

Redmine requires some RubyGems to be installed and there are multiple ways of installing them (as listed on the referenced page).

  • prototype-rails
  • unicorn (an application-server)
  • mysql2 (high-performance Ruby bindings for MySQL)
  • coderay
  • erubis
  • fastercsv
  • rdoc
  • net-ldap
  • rack-openid

Obviously, if you choose a different database-server, or want to use a different application-server you should replace mysql2 and unicorn to your liking.

Adding Additional Gems (Optional)

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named Gemfile.local at the root of your redmine directory. It will be loaded automatically when running bundle install:

# nano Gemfile.local
gem 'puma'

Check previously installed gems

The Redmine devs included Bundler in Redmine, which can manage Gems just like pacman manages packages. Run the following command to assure that all Redmine dependencies are met:

# bundle install --without development test

This should output a list of gems Redmine needs.

Gems Installation

Note: If you prefer, you can install all the gems as pacman packages. You have only to search for the gem package and install them as usual. As of using Ruby gem is much simpler to manage and maintain up to date gems, this will be preferable and used as default bellow.

Redmine uses Bundler to manage gems dependencies. So, you need to install Bundler first:

# gem install bundler

Then you can install all the gems required by Redmine using the following command:

# cd /usr/share/webapps/redmine
# bundle install

To install without the ruby development and test environments use this instead of the last command:

# bundle install --without development test
Note: You can include/exclude environments using the above syntax.

Although imagemagick is highly recommended, if you do not use it, you should skip the installation of the rmagick gem using:

# bundle install --without rmagick
Note: Only the gems that are needed by the adapters you have specified in your database configuration file are actually installed (eg. if your config/database.yml uses the mysql2 adapter, then only the mysql2 gem will be installed). Do not forget to re-run bundle install when you change or add adapters in this file.

Session Store Secret Generation

Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:

# bundle exec rake generate_secret_token
Note: For Redmine prior to 2.x this step is done by executing # bundle exec rake generate_session_store.
Warning: Generating a new secret token invalidates all existing sessions after restart.

Database Structure Creation

With the database created and the access configured for Redmine, now it is time to create the database structure. This is done by running the following command under the application root directory:

# cd /usr/share/webapps/redmine
# RAILS_ENV=production bundle exec rake db:migrate

These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

Database Population with Default Data

Now you may want to insert the default configuration data in database, like basic types of task, task states, groups, etc. To do so execute the following:

# RAILS_ENV=production bundle exec rake redmine:load_default_data

Redmine will prompt for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task:

# RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake redmine:load_default_data
Note: This step is not mandatory, but it certainly will save you a lot of work to start using Redmine. And for a first time it can be very instructive.

File System Permissions

The user account running the application must have write permission on the following subdirectories:

files: storage of attachments.
log: application log file production.log.
tmp and tmp/pdf: used to generate PDF documents among other things (create these ones if not present).

Assuming you run the application with a the default Apache user http account:

# mkdir tmp tmp/pdf public/plugin_assets
# chown -R http:http files log tmp public/plugin_assets
# chmod -R 755 files log tmp tmp/pdf public/plugin_assets

Test the installation

To test your new installation using WEBrick web server run the following in the Redmine folder:

# ruby bin/rails server webrick -e production

Once WEBrick has started, point your browser to http://localhost:3000/. You should now see the application welcome page. Use default administrator account to log in: admin/admin. You can go to Administration menu and choose Settings to modify most of the application settings.

Warning: Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.

Configure the production server

For Apache and Nginx, it is recommended to use Phusion Passenger. Passenger, also known as mod_rails, is a module available for Nginx and Apache.

Start by installing the 'passenger' gem:

# gem install passenger

Now you have to look at your passenger gem installation directory to continue. If you do not known where it is, type:

# gem env

And look at the GEM PATHS to find where the gems are installed. If you followed this guide and installed RVM, you can have more than one path, look at the one you are using.

For this guide so far, the gem path is /usr/local/rvm/gems/ruby-2.0.0-p247@global.

# cd /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/passenger-4.0.23

If you are aiming to use Apache, run:

# passenger-install-apache2-module

In case a rails application is deployed with a sub-URI, like http://example.com/yourapplication, some additional configuration is required, see the modrails documentation

For Nginx:

# passenger-install-nginx-module

And finally, the installer will provide you with further information regarding the installation (such as installing additional libraries). So, to setup your server, simply follow the output from the passenger installer.

Updating

Backup the files used in Redmine:

# tar czvf ~/redmine_files.tar.gz -C /usr/share/webapps/redmine/ files

Backup the plugins installed in Redmine:

# tar czvf ~/redmine_plugins.tar.gz -C /usr/share/webapps/redmine/ plugins

Backup the database:

# mysqldump -u root -p <redmine_database> | gzip > ~/redmine_db.sql.gz

Update the package as normal (through AUR):

# wget https://aur.archlinux.org/packages/re/redmine/redmine.tar.gz
# tar -zxpvf redmine.tar.gz
# cd redmine

Inspect the downloaded files, mainly the PKGBUILD, and then build:

# makepkg -s
# pacman -U redmine-2.3.0-2-any.pkg.tar.gz
Note: To simplify all this AUR install and update process, you can always use the AUR helpers, although this is not a supported way.

Update the gems requirements:

#  bundle update

For a clean gems environment, you may want to remove all the gems and reinstall them. To go through this, do:

# for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done
Warning: The command above will delete ALL the gems in your system or user, depending of what type of Ruby installation you did in the prerequisites step. You must take care or you can stop working another applications that rely on Ruby gems.

If you did the last step and removed all the gems, now you will need to reinstall them all:

# gem install bundler
# bundle install --without development test
Note: If you removed ALL the gems as above, and used a server that uses a gem, remember to reinstall the server gem: passenger (for Apache and Nginx), Mongrel or Unicorn. To do this, just follow the steps in the installation tutorial above.

Copy the saved files:

# tar xzvf ~/redmine_files.tar.gz -C /usr/share/webapps/redmine/

Copy the installed plugins

# tar xzvf ~/redmine_plugins.tar.gz -C /usr/share/webapps/redmine/

Regenerate the secret token:

# cd /usr/share/webapps/redmine
# bundle exec rake generate_secret_token

Check for any themes that you may have installed in the public/themes directory. You can copy them over but checking for updated version is ideal.

Warning: Do NOT overwrite config/settings.yml with the old one.

Update the database. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:

# RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake db:migrate

If you have installed any plugins, you should also run their database migrations:

# RAILS_ENV=production REDMINE_LANG=pt-BR bundle exec rake redmine:plugins:migrate

Now, it is time to clean the cache and the existing sessions:

# RAILS_ENV=production bundle exec rake tmp:cache:clear tmp:sessions:clear

Restart the application server (e.g. puma, thin, passenger, etc). And finally go to "Admin -> Roles & permissions" to check/set permissions for the new features, if any.

Troubleshooting

RMagick gem without support for High Dynamic Range in ImageMagick

As of ImageMagick 6.8.6.8-1, it is built with HDRI (High Dynamic Range Image) support, and this breaks the RMagick gem as seen in FS#36518.

The github rmagick is already patched, but the mantainer did not packed it for rubygems yet.

To install this patched version download the git repository:

# git clone https://github.com/rmagick/rmagick.git

Then, you need to build the gem:

# cd rmagick
# gem build rmagick.gemspec

And finally install it:

# gem install rmagick-2.13.2.gem
Note: It will show some complains like unable to convert "\xE0" from ASCII-8BIT to UTF-8 for ext/RMagick/RMagick2.so, skipping, but you can safelly ignore it.

Runtime error complaining that RMagick was configured with older version

If you get the following runtime error after upgrading ImageMagick This installation of RMagick was configured with ImageMagick 6.8.7 but ImageMagick 6.8.8-1 is in use. then you only need to reinstall (or rebuild as shown above if is the case).

Note: This is due to that when you install the RMagick gem it compiles some native extensions and they may need to be rebuilt after some ImageMagick upgrades.

OpenSSL error about "SSLv3_client"

After thel latest OpenSSL release (version 1.0.2.g-3) the ruby stop to work and you cannot build some ruby versions. You have two way to fix it:

1. Use ruby-head (if using RVM) or 2.3.0or above (if using arhc package).

2. Use this patch as noted in Issue 3529 and Issue 3548

# curl https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff > openssl.patch
# rvm install --patch ./openssl.patch 2.0.0 /*or another ruby version*/

Error when installing gems: Cannot load such file -- mysql2/mysql2

If you see an error like cannot load such file -- mysql2/mysql2, you are having a problem with the installation of the database gem. Probably a misconfiguration in the Database Access Configuration step. In this case you should verify the database.yml file.

If no success, you can manually install the database gem by:

# gem install mysql2

In last case, as suggested by Bobdog, you can try to comment the line of the database gem and add a new one as bellow:

<path-to-mysql2-gem-directory>/lib/mysql2/mysql2.rb

 # require 'mysql2/mysql2'
 require '<path-to-mysql2-gem-directory>/lib/mysql2/mysql2.so'

Apache 2.4 Updating

When updating to Apache 2.4 will be necessary to remove and install all your gems to make sure all of them that need to build native extensions will be rebuilt against the new Apache server.

So, for a clean gems environment, remove all the gems:

# for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done

To reinstall the gems:

# cd /usr/share/webapps/redmine
# gem install bundler
# bundle install --without development test

Remember to reinstall the RMagick gem as describe above in RMagick gem without support for High Dynamic Range in ImageMagick.

And if you are using Passenger to serve your apps through Apache you will need to reinstall it as described above in Configure the production server.

Checkout SVN Source

Get the Redmine source (Download instructions). Here is method of installing Redmine directly from subversion in /srv/http/redmine/

# useradd -d /srv/http/redmine -s /bin/false redmine
# mkdir -p /srv/http/redmine
# svn checkout http://svn.redmine.org/redmine/branches/2.1-stable /srv/http/redmine
# chown -R redmine: /srv/http/redmine

Automating The Update Process

Example of an after-update script:

#!/usr/bin/bash
export RAILS_ENV=production
grep -E "^gem 'thin'" Gemfile || echo "gem 'thin'" >> Gemfile
bundle update && bundle exec rake generate_secret_token db:migrate redmine:plugins:migrate tmp:cache:clear tmp:sessions:clear
Note: Note that this script uses Thin as application server, so you must change it to your needs.

Creating a Systemd Unit

If you want to automatic run you application server when system starts, you need to create a systemd unit file.

Note: This is not needed if you use apache or nginx with Passenger gem. Those servers already have their own unit file, so you have only to enable it.
/etc/systemd/system/redmine.service
[Unit]
Description=Redmine server
After=syslog.target
After=network.target

[Service]
Type=simple
User=redmine2
Group=redmine2
Environment=GEM_HOME=/home/redmine2/.gem/
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

[Install]
WantedBy=multi-user.target

Complaints about psych

Like that:

/usr/lib/ruby/2.1.0/psych/parser.rb:33:in `<class:Parser>': superclass mismatch for class Mark (TypeError)
from /usr/lib/ruby/2.1.0/psych/parser.rb:32:in `<module:Psych>'
from /usr/lib/ruby/2.1.0/psych/parser.rb:1:in `<top (required)>'
from /usr/lib/ruby/2.1.0/psych.rb:7:in `require'

according to that that is a bundler issue, and you have to add

gem 'psych'

to your Gemfile.local

See also