📜 ⬆️ ⬇️

Installing and configuring Redmine 1.3.0 on Windows XP SP2 / Windows 7

Introduction to Ruby on Rails (RoR)


In my daily life there was a need to use a web application for project management, Redmine. Since I use Windows XP SP2 on my home PC, I assumed a number of problems with installing and configuring Redmine. In general, the way it happened.

After killing from 5 to 6 hours to search for documentation on installing and fixing errors, I still managed to see in my browser interface Redmine * HAPPINESS *.

In this article I will try to tell you about installing and configuring all the necessary components to use 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 is like the 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.

With all the subsequent terms you can find in Wikipedia.

Redmine we will use with the MySQL database. This article will not discuss the installation and configuration of MySQL. It is assumed that it is already installed and configured.

Let's start in order.

Stage 1 (Installing Ruby and Redmine)


First we need to install Ruby, but do not rush! This whole bundle of Ruby + Ruby on Rails is very capricious of component versions. Therefore, first you need to see and decide which version of Redmine we will use. Compatibility table can be found at www.redmine.org/projects/redmine/wiki/RedmineInstall

This article will discuss the installation of Redmine 1.3. *. Therefore, for it we will use Ruby 1.8.7, Rails 2.3.14. The table also lists additional versions of components that are necessary for the proper 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, put a tick "Add Ruby executables to your Path". Installation completed.

Now you need to download Redmine 1.3.0 from rubyforge.org/frs/?group_id=1850
Create an apps directory in C: \ Ruby \. It will be our applications. We transfer the archive from Redmine to C: \ Ruby \ apps \. Extract to the current folder and rename redmine-1.3.0 to redmine. Total we get installed Ruby and unpacked framework in C: \ Ruby \ apps \ redmine \.

2nd Stage (Installing Rails)


Now we need to install the Ruby on Rails (RoR) framework for Redmine. Unforgettable that we need version 2.3.14, so when installing we explicitly indicate the version. Start -> Run -> cmd, opened the command line. Execute commands:

cd C:\ gem install rails –v=2.3.14 

After installation you can view a list of installed packages and their versions. Team:

 cd C:\ gem list 

In Windows 7, an error occurred with these commands associated with the 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 performing the above commands.

Stage 3 (Installing Rack)


What is Rack? Honestly no idea. I read somewhere that it serves to provide interaction between web servers. The compatibility tables on the Redmine site for version 1.3.0 require Rack 1.1. *. Again, install by 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.
Downloading DevKit rubyinstaller.org/downloads
We unpack it in C: \ Ruby \ devkit \

Execute 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 

Stage 5 (Possible problems with rubytree)


In the future, we may have problems with the rubytree component. To prevent them from happening in the future, execute the command:

 cd C:\ rake gems:refresh_specs 

Stage 6 (RubyGems Update)


Compatibility tables indicate that a version not higher than 1.7.0 is needed. 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 a 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. remove:

 DROP USER 'redmine'@'localhost'; 

We give all 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
The library is moved to C: \ Ruby \ bin \

Open the directory C: \ Ruby \ apps \ redmine \ config \. In this directory, make a copy of the database.yml.example file and rename it to database.yml, open it.

Set up a MySQL connection for the production version. We save.

 production: adapter: mysql database: redmine host: localhost username: redmine password: 12345 encoding: utf8 

Now we need to install the component to work with MySQL:

 cd C:\ gem install mysql 

9th stage (Creating a database structure and entering data)


Execute 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.

10th stage (Finally)


Now we can launch Webrick’s embedded web server and test the performance 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.
Standard login and password for administrator: admin / admin
This web server is not recommended for permanent use, therefore in the next article we will look at the installation and configuration of Mongrel.

To close the webrick, in cmd press Ctrl + C.

Source: https://habr.com/ru/post/169805/


All Articles