Top / Redmine / インストール

Redmineのインストールは、Rubyを入れたりmongrelってのを入れたり、MySQLが必要だったりかなりメンドウでした。以下にメモっときます。

ruby のインストール

[root@www ~]#  yum install ruby rdoc ruby-devel
Total download size: 2.6 M
Is this ok [y/N]: y
Complete!
[root@www ~]# rpm -qa | grep ruby
ruby-1.8.5-5.el5_4.8
ruby-libs-1.8.5-5.el5_4.8
ruby-rdoc-1.8.5-5.el5_4.8
ruby-irb-1.8.5-5.el5_4.8
ruby-devel-1.8.5-5.el5_4.8
[root@www ~]# 
[root@centos redmine-1.0.0]# yum install mysql-devel

checkinstall のインストール

[root@www ~]# yum install checkinstall

これがNGの場合は、rpmforgeがインストールされてない可能性があるのでCentOSでcheckinstallをインストールできない - 拡張現実ライフ - モバイルデジタルサイネージ編 を見ながらインストールしてください。

rubygems のインストール

[root@www tmp]# yum install rpm-build
Total download size: 722 k
Is this ok [y/N]: y
Complete!
[root@www tmp]# wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
--2010-07-27 10:40:32--  http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
100%[==============================================================================>] 278,469      142K/s 時間 1.9s
[root@www tmp]# tar xzf rubygems-1.3.5.tgz
[root@www tmp]# cd rubygems-1.3.5
[root@www rubygems-1.3.5]# checkinstall -R "ruby setup.rb"

いろいろ聞いてきますが、基本デフォルトでOK。

checkinstall 1.6.0, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.
========================= Installation results ===========================
RubyGems 1.3.5 installed

**********************************************************************
 Done. The new package has been saved to

 /usr/src/redhat/RPMS/i386/rubygems-1.3.5-1.i386.rpm
 You can install it in your system anytime using:

      rpm -i rubygems-1.3.5-1.i386.rpm

**********************************************************************

[root@www rubygems-1.3.5]# rpm -Uvh /usr/src/redhat/RPMS/i386/rubygems-1.3.5-1.i386.rpm
準備中...                ########################################### [100%]
   1:rubygems               ########################################### [100%]
[root@www rubygems-1.3.5]#
[root@www rubygems-1.3.5]# rpm -qa | grep rubygems
rubygems-1.3.5-1

rubygems でmongrelをインストール

[root@www rubygems-1.3.5]# gem install mongrel
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed gem_plugin-0.2.3
Successfully installed daemons-1.1.0
Successfully installed fastthread-1.0.7
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed mongrel-1.1.5
5 gems installed
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for daemons-1.1.0...
Installing ri documentation for fastthread-1.0.7...
Installing ri documentation for cgi_multipart_eof_fix-2.5.0...
Installing ri documentation for mongrel-1.1.5...
Installing RDoc documentation for gem_plugin-0.2.3...
Installing RDoc documentation for daemons-1.1.0...
Installing RDoc documentation for fastthread-1.0.7...
Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...
Installing RDoc documentation for mongrel-1.1.5...

rubygems でrailsをインストール、稼動確認

[root@www rubygems-1.3.5]# cd /tmp/
[root@www tmp]# gem install rails
Successfully installed rake-0.8.7
Successfully installed activesupport-2.3.8
Successfully installed activerecord-2.3.8
Successfully installed rack-1.1.0
Successfully installed actionpack-2.3.8
Successfully installed actionmailer-2.3.8
Successfully installed activeresource-2.3.8
Successfully installed rails-2.3.8
8 gems installed
Installing ri documentation for rake-0.8.7...
Installing ri documentation for activesupport-2.3.8...
Installing ri documentation for activerecord-2.3.8...
Installing ri documentation for rack-1.1.0...
Installing ri documentation for actionpack-2.3.8...
Installing ri documentation for actionmailer-2.3.8...
Installing ri documentation for activeresource-2.3.8...
Installing ri documentation for rails-2.3.8...
Installing RDoc documentation for rake-0.8.7...
Installing RDoc documentation for activesupport-2.3.8...
Installing RDoc documentation for activerecord-2.3.8...
Installing RDoc documentation for rack-1.1.0...
Installing RDoc documentation for actionpack-2.3.8...
Installing RDoc documentation for actionmailer-2.3.8...
Installing RDoc documentation for activeresource-2.3.8...
Installing RDoc documentation for rails-2.3.8...
[root@www tmp]#
[root@www tmp]# gem list

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
cgi_multipart_eof_fix (2.5.0)
daemons (1.1.0)
fastthread (1.0.7)
gem_plugin (0.2.3)
mongrel (1.1.5)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
[root@www tmp]# 
[root@www tmp]# rails  rails-demo
[root@www tmp]# cd rails-demo/
[root@www rails-demo]#
[root@www rails-demo]# mongrel_rails start -d -p 3000 -e production
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
[root@www rails-demo]# nmap localhost

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-07-27 11:02 JST
Interesting ports on www.masatom.in (127.0.0.1):
Not shown: 1665 closed ports
PORT     STATE SERVICE
3000/tcp open  ppp

Nmap finished: 1 IP address (1 host up) scanned in 0.099 seconds
[root@www rails-demo]#

port番号3000 でmongrelが起動しました。

mysql-rubyのインストール

[root@centos tmp]# wget http://rubyforge.org/frs/download.php/44203/mysql-ruby-2.7.7.tar.gz
[root@centos tmp]# tar xzf mysql-ruby-2.7.7.tar.gz 
[root@centos tmp]# cd mysql-ruby-2.7.7
[root@centos mysql-ruby-2.7.7]# ruby extconf.rb --with-mysql-config=/usr/lib/mysql/mysql_config
checking for mysql_ssl_set()... yes
checking for mysql.h... yes
creating Makefile
[root@centos mysql-ruby-2.7.7]# make
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H  
-I/usr/include/mysql  -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic 
-fasynchronous-unwind-tables -Wall -fno-strict-aliasing  -fPIC  -c mysql.c
mysql.c: In function ‘stmt_execute’:
mysql.c:1393: 警告: ‘t.time_type’ is used uninitialized in this function
mysql.c:1406: 警告: ‘t.time_type’ is used uninitialized in this function
gcc -shared  -L"/usr/lib" -o mysql.so mysql.o  -lruby -rdynamic -L/usr/lib/mysql -lmysqlclient 
-lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto  -lpthread -ldl -lcrypt -lm   -lc
[root@centos mysql-ruby-2.7.7]# make install
/usr/bin/install -c -m 0755 mysql.so /usr/lib/ruby/site_ruby/1.8/i386-linux

redmineのインストール・設定、mysqlのデータベースの作成

redmineのインストール

[root@centos tmp]# wget http://rubyforge.org/frs/download.php/71723/redmine-1.0.0.tar.gz
Saving to: `redmine-1.0.0.tar.gz'

100%[=======================================>] 4,703,623   1.41M/s   in 5.0s   

12:38:26 (921 KB/s) - `redmine-1.0.0.tar.gz' を保存しました [4703623/4703623]

[root@centos tmp]# cd opt
[root@centos opt]# tar xzf /tmp/redmine-1.0.0.tar.gz 
[root@centos opt]# cd redmine-1.0.0

mysqlのデータベースの作成

[root@centos redmine-1.0.0]# mysql -u root -p
mysql> grant all privileges on redmine.* to redmine identified by 'xxxx';
mysql> quit
[root@db ~]# mysql -uredmine -p
Enter password: 

mysql> create database redmine;
Query OK, 1 row affected (0.00 sec)

mysql> quit
Bye
[root@centos redmine-1.0.0]# cp -pfr ./config/database.yml.example ./config/database.yml

[root@centos redmine-1.0.0]# rake config/initializers/session_store.rb
[root@centos redmine-1.0.0]# rake db:migrate RAILS_ENV="production"
(in /tmp/redmine-1.0.0)
rake aborted!
RubyGem version error: rack(1.1.0 not ~> 1.0.1)

(See full trace by running task with --trace)

なんだか失敗するみたいなので、メッセージ通り別バージョンのrackをインストールする。

[root@centos redmine-1.0.0]# gem install rack --version '~> 1.0.1'
Successfully installed rack-1.0.1
1 gem installed
Installing ri documentation for rack-1.0.1...
Installing RDoc documentation for rack-1.0.1...
[root@centos redmine-1.0.0]#
[root@centos redmine-1.0.0]# rake db:migrate RAILS_ENV="production"
[root@centos redmine-1.0.0]# rake redmine:load_default_data RAILS_ENV=production
(in /tmp/redmine-1.0.0)

Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, 
mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-CY, sv, th, tr, uk, vi, zh, zh-TW [en] ja
====================================
Default configuration data loaded.
[root@centos redmine-1.0.0]# 
[root@db  redmine-1.0.0]#  mysqlshow redmine -uredmine -p

でテーブルが作られた確認することができます。

Redmineを起動してみる

[root@centos redmine-1.0.0]# script/server -e production
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

Processing WelcomeController#index (for 192.168.183.1 at 2010-07-27 13:19:53) [GET]
  Parameters: {"action"=>"index", "controller"=>"welcome"}
Rendering template within layouts/base
Rendering welcome/index
Completed in 82ms (View: 30, DB: 13) | 200 OK [http://192.168.183.132/]

http://[hostname]:3000 にアクセスして以下のような画面が出てくれば、インストールは完了です。

redmine.png

admin /admin でログインすることができます。

ここまでインストールは完了です。さいごに Apacheと連係するやり方ですがRedmineとApacheを連携するにまとめました。

関連リンク


この記事は

選択肢 投票
おもしろかった 1  
そうでもない 0  
  • この記事は相当古い記事で、いまはインストールもずいぶんらくになりましたー -- きの? 2013-08-12 (月) 20:42:04

Top / Redmine / インストール

現在のアクセス:4569


添付ファイル: fileredmine.png 691件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2013-08-12 (月) 20:42:05 (3902d)