Installing and Configuring Redmine 1.3.0 on Windows XP SP2 / Windows 7
Introducing Ruby on Rails (RoR)
In my daily life, the need arose to use a web-based project management application, Redmine. Since I use Windows XP SP2 on my home PC, I suggested a number of problems with installing and configuring Redmine. In general, it turned out that way.
After killing 5 to 6 hours to search for documentation on installing and fixing errors, I still managed to see the Redmine * HAPPINESS * interface in my browser.
In this article I will try to tell you about installing and configuring all the necessary components for using Redmine on Windows XP SP2 / Windows 7. Let's start with terms and names.
What is Ruby?
Ruby is a high-level programming language for object-oriented programming.
What is Rails (RoR)?
Simply put, this is a Framework developed in Ruby, it's like a Zend Framework in PHP.
What is a gem?
In the article we will see this word more than once. Gem is a package manager for Ruby, i.e. with it we install, update the components we need for Ruby.
You can familiarize yourself with all the following terms on Wikipedia.
We will use Redmine with the MySQL database. This article will not cover installing and configuring MySQL. It is assumed that it is already installed and configured.
Let's start in order.
Stage 1 (Installing Ruby and Redmine)
To start, we need to install Ruby, but do not rush! This whole bunch of Ruby + Ruby on Rails is very moody about component versions. Therefore, first you need to look and decide which version of Redmine we will use. The compatibility chart can be viewed at www.redmine.org/projects/redmine/wiki/RedmineInstall
This article will cover the installation of Redmine 1.3. *. Therefore, for it we will use Ruby 1.8.7, Rails 2.3.14. The table also lists the additional versions of the components that are necessary for the correct operation of Redmine (rack and rubygems).
Download Ruby 1.8.7 from rubyinstaller.org/downloads
During installation, specify the path C: \ Ruby \ and do not forget to check the "Add Ruby executables to your Path" checkbox. Installation completed.
Now you need to download Redmine 1.3.0 from rubyforge.org/frs/?group_id=1850
Create the apps directory in C: \ Ruby \. It will contain our applications. Transfer the archive from Redmine to C: \ Ruby \ apps \. Extract to the current folder and rename redmine-1.3.0 to redmine. In total, we get the installed Ruby and the unpacked framework in C: \ Ruby \ apps \ redmine \.
Stage 2 (Installing Rails)
Now we need to install the Ruby on Rails (RoR) framework for Redmine. It is unforgettable that we need version 2.3.14, so during installation we explicitly specify the version. Start -> Run -> cmd, open a command prompt. We execute the commands:
cd C:\
gem install rails –v=2.3.14
After installation, you can view a list of installed packages and their versions. Command:
cd C:\
gem list
In Windows 7, an error occurred with these commands related to paths. It is solved quite simply. Open C: \ Ruby \ bin \ gem.bat in the editor and change:
@ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=C:
SET HOMEPATH=Ruby
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/Ruby/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
SET HOMEDRIVE=%_HOMEDRIVE%
SET HOMEPATH=%_HOMEPATH%
After we execute the above commands.
Stage 3 (Installing Rack)
What is a Rack? Honestly without a clue. I read somewhere that it serves to ensure interaction between web servers. The compatibility tables on the Redmine website for version 1.3.0 require Rack 1.1. *. Install again, explicitly specifying the component version:
cd C:\
gem install rack –v=1.1.0
4th stage (DevKit + RDoc)
We need to install the rdoc component, but in order to install it we need to configure DevKit.
Download DevKit rubyinstaller.org/downloads
We unpack it in C: \ Ruby \ devkit \ We execute the
commands:
cd C:\Ruby\devkit\
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
If the installation was successful, try installing RDoc:
cd C:\
gem install rdoc
5th stage (Possible problems with rubytree)
In the future, we may have problems with the rubytree component. In order to avoid them in the future, execute the command:
cd C:\
rake gems:refresh_specs
Stage 6 (RubyGems Update)
The compatibility table indicates that you need version no higher than 1.7.0. Let's update our package manager with version 1.6.2 by running the command:
cd C:\
gem update –system=1.6.2
7th stage (MySQL)
Now, perhaps we will create a Redmine database and user for it:
CREATE DATABASE `redmine` CHARACTER SET UTF8;
Create a user for Redmine:
CREATE USER 'redmine'@'localhost' IDENTIFIED BY '12345';
If this user already exists, recreate it, i.e. delete:
DROP USER ‘redmine’@’localhost’;
We give all the rights for the redmine user for the Redmine database:
GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’;
FLUSH PRIVILEGES;
Stage 8 (Configuring Redmine and Ruby to work with MySQL)
To work with MySQL we still need to download the DLL library libmySQL.dll
Download instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll Move the
library to C: \ Ruby \ bin \
Open the C directory : \ Ruby \ apps \ redmine \ config \. In this directory, make a copy of the database.yml.example file and rename it to database.yml, open it.
Let's configure the connection to MySQL for the production version. Save.
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: 12345
encoding: utf8
Now we need to install the component for working with MySQL:
cd C:\
gem install mysql
9th stage (Creating a database structure and entering data)
We execute the commands:
cd C:\Ruby\apps\redmine\
rake generate_session_store
set RAILS_ENV=production
rake db:migrate
rake redmine:load_default_data
I think everything is clear here.
10th stage (Finally)
Now we can start the built-in web server Webrick and check the operability of our web application:
cd C:\Ruby\apps\redmine\
ruby script/server webrick –e production
If everything went well, open localhost : 3000 / and see the Redmine welcome window.
The standard username and password for the administrator: admin / admin.
For continuous operation, this Web server is not recommended, so in the next article we will consider installing and configuring Mongrel.
To close Webrick, in cmd, press Ctrl + C.