1、使用Ruby 1.9 + Redmine 2.0,有些插件安装时可能会出现问题,例如:
A、Scrum插件scrum-pm(redmine_sprints)
Error message: no such file to load -- dispatcher Exception class: LoadError Application root: /usr/share/redmine
第三方库引用出现问题,可能是由Ruby 1.9较之前版本的改动引起。scrum-pm官方并未说明支持Ruby 1.9,scrum-pm官方已经停止支持。
2、暂时建议使用低版本Ruby(1.8) 和 低版本Redmine(1.4)
一、安装环境
1、操作系统root@ :~# lsb_release -a
No LSB modules are available.
Distributor ID:Ubuntu
Description:Ubuntu 10.04.1 LTS
Release:10.04
Codename:lucid
2、已经正常安装 MySql(sudo apt-get install mysql-server libmysqlclient-dev) :
root@ :~# mysql --version
mysql Ver 14.14 Distrib 5.1.54, for debian-linux-gnu (i686) using readline 6.2
3、已经正常安装 Apache2
root@ :~# apache2 -v
Server version: Apache/2.2.17 (Ubuntu)
Server built: Feb 22 2011 18:34:09
二、安装ruby 1.9 (含gem)
1、安装依赖包:
root@ :~# sudo apt-get install gcc g++ build-essential libssl-dev libreadline-dev zlib1g-dev linux-headers-generic libyaml-dev
2、下载ruby 1.9 最新稳定版
root@ :~# wget
root@ :~# tar -zxf ./ruby-1.9-stable.tar.gz
3、编译ruby源码
root@ :~# cd ruby-1.9.3-p194/
root@ :~/ruby-1.9.3-p194# ./configure --prefix=/usr/local/ruby
root@ :~/ruby-1.9.3-p194# make && sudo make install
4、ruby环境变量设置
#PATH设置
root@ :~/ruby-1.9.3-p194# sudo vi /etc/environment
#PATH中添加/usr/local/ruby/bin:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
root@ :~/ruby-1.9.3-p194# source /etc/environment#检查PATH设置
root@ :~/ruby-1.9.3-p194# ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
root@ :~/ruby-1.9.3-p194# gem -v
1.8.23
#修改GEM_HOME
root@ :~/ruby-1.9.3-p194# sudo vim /etc/profile
#/etc/profile中添加:
export GEM_HOME=/usr/local/ruby/lib/ruby/gems/1.9.1/ export RUBYOPT=rubygems
root@ :~/ruby-1.9.3-p194# source /etc/profile#修改 gem 源(你懂的)
root@ :~# gem source
*** CURRENT SOURCES ***
root@ :~# gem source --clear-all
*** Removed specs cache ***
root@ :~# gem source --add
added to sources
5、安装bundler
root@ :~# gem install bundler
root@ :~# ln -s /usr/local/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/bin/bundle /usr/local/ruby/bin/bundle
三、安装redmine 2.0.3
1、下载redmine
root@ :~# git clone https://github.com/redmine/redmine.git
root@ :~# mv -f ./redmine/ /usr/share/redmine
root@ :~# cd /usr/share/redmine/
root@ :/usr/share/redmine# rm -Rf ./.git
2、修改Gemfile
root@ :/usr/share/redmine# vim ./Gemfile
#将source 修改为(我们都懂)
source 'http://ruby.taobao.org/'
#若是用mysql可以将postgresql相关注释掉# Database gems #platforms :mri, :mingw do # group :postgresql do # gem "pg", ">= 0.11.0" # end
3、安装redmine 依赖包#可能出现的错误(错误可能会非常多,慢慢解决吧,以下几个典型):
A、An error occured while installing mysql2 (0.3.11), and Bundler cannot continue.
#请先安装libmysqlclient-dev
root@ :~# sudo apt-get install libmysqlclient-dev
B、An error occured while installing pg (0.14.0), and Bundler cannot continue.
#使用mysql的可以将pg从Gemfile中删除,或者安装postgresql,我选择不安装pg
C、An error occured while installing rmagick (2.13.1), and Bundler cannot continue.
#需要安装imagemagick
root@ :~# sudo apt-get install imagemagick
3、数据库创建、配置(myql)
root@ :/usr/share/redmine# mysql -p
create database redmine character set utf8; create user 'redmine'@'localhost' identified by 'my_password'; grant all privileges on redmine.* to 'redmine'@'localhost';
root@ :/usr/share/redmine# cp config/database.yml.example config/database.ymlroot@ :/usr/share/redmine# vim config/database.yml