Tuesday, July 19, 2016

Install Redmine using XAMPP, MySQL, Ruby on Rails

Filled under:

bellow are the requirement that we use to install redmine.

  • XAMPP v3.2.1
  • Ruby 2.2.4
  • Redmine 3.0.4
  • DevKit 4.7.2

1.        XAMPP Bitnami Installation

1.1.       Install XAMPP Bitnami dengan menggunakan xampp-win32-1.8.2-1-VC9-installer.exe. Before run the application, please turn off the antivirus which is running on PC.
1.2.       Please ignore the warning and continue the installation by clicking OK

Figure 1 Bitnami Installation warning

1.3.       Follow the instruction by only clicking Next tombol
1.4.       Make sure that the application path is already exist in the system drive by going to C:/xampp/htdocs
1.5.       Create folder dev-ruby inside htdocs
1.6.       Put redmine folder from bundle inside dev-ruby folder and just use the simple name for redmine folder by removing version number

Figure 2 Redmine folder in the xampp application

1.7.       After the installation completed, please open XAMPP Control Panel and you will see the following layout

Figure 3 XAMPP Control Panel v3.2.1
1.8.       Before start Apache and MySQL Service, please open the configuration file by clicking Config and choose Apache (http.conf)
1.9.       Please find Listen 80 line in the file and add Listen 3000 as the Ruby and Rails port.

Figure 4 Port Listening



1.10.   Add the following syntax at the end of file to create Virtual Host for Ruby and Rails
<VirtualHost *:3000>
   ServerName localhost
   DocumentRoot “C:/xampp/htdocs/dev-ruby/redmine/public”
<Directory “C:/xampp/htdocs/dev-ruby/redmine/”>
     Option Indexes FollowSymLinks Includes ExecCGI
     AllowOverride none
     Require all granted
<Directory>
</VirtualHost>

Use path which is defined in step 1.5 and step 1.6 to replace ~/dev-ruby/redmine

1.11.   Open Xampp control panel and Start Apache and MySql by clicking Start tombol and make sure that port 3000 is listed between Apache and Start tombol, and port 3306 is listed between MySQL and Start tombol

Figure 5 Starting Apache and MySQL


1.12.   Create redmine database in phpmyadmin by going to localhost/xampp (in this case I use port 90 for phpmyadmin, so I use localhost:90/xampp)

Figure 6 Creating Redmine Database

1.13.   Please go to the browser and go to URL : localhost:3000. Make sure that the redmine file will be listed in the homepage.

Figure 7 Listen localhost:3000
1.14.   if you get the above result, it means that the virtual host for Ruby and rails is ready to be used.


2.        Ruby on Rails Installation

2.1.       Install ruby installer using rubyinstaller-2.2.4-x64.exe in the bundle. Please follow the instruction and make sure you check Add Ruby executables to your PATH such the following picture and click Install

Figure 8 Installing Ruby
2.2.       Make sure that Ruby is already installed in the System, then put DevKit folder from bundle to the System parallel with installed Ruby22-64 folder

Figure 9 DevKit Folder

2.3.       Copy libmysqld.lib from C:\xampp\mysql\lib into C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\mysql2-0.4.4-x64-mingw32\vendor
2.4.       Open DevKit folder and run msys.bat
2.5.       On msys.bat run the following command:
cd C:/DevKit
ruby db.rk init
ruby db.rk install
2.6.       Close the msys.bat and open command prompt as administrator
2.7.       Check Ruby version
ruby -v
expected result:

Figure 10 Checking Ruby Version
2.8.       Check Gem version
gem -v

Figure 11 Checking Gem Version
2.9.       Install Ruby on rails in the folder which is defined in Step 1.5, in this case we use dev-ruby folder with the following syntax:
cd C:/xampp/htdocs/dev-ruby
gem install bundler
gem install rake
gem install rails -v=4.2.6
gem install mongrel -v 1.2.0.pre2 -- --with-cflags=\"-02 -pipe -march=native -w\"
gem install mongrel --pre
gem install mysql2
2.10.   If there is at least one line couldn’t be run, please type bundle install --without rmagick
2.11.   Open redmine folder C:\xampp\htdocs\dev-ruby\redmine\config, and Copy-paste database.yml.example, rename it tobe database.yml and then open it by using text editor such notepad.
2.12.   Only use the following code in the database.yml file:
development:
  adapter: mysql2
  database: redmine
  host: localhost
  username: root
  password: ""
  encoding: utf8
port: 3306


Figure 12 Configuring database.yml in redmine

2.13.   Open the command prompt again and go to redmine folder, then migrate the database into phpmyadmin by typing rake db:migrate
2.14.   Open the command prompt again and go to redmine folder, then type rails server

Figure 13 Start Redmine Service


2.15.   Go to URL: localhost:3000 from your local computer, but if you want to make this redmine readable from another computer, just simply type rails s -b 192.168.1.74 -p 3000 and Go to URL: 192.168.1.74:3000 and Enjoy Redmine!

Posted By Novida12:30 PM