前提安装redmine ruby环境版本要求:

wKiom1amI3PwuhoAAAAmbAZyHPQ476.png


  1. 1.      安装依赖关系

yum install zlib*

yum install openssl*

       yum install ImageMagick-devel –y

 

  1. 2.      安装ruby

tar -zxvf ruby-2.0.0-p481.tar.gz

./configure --prefix=/usr/local/ruby

Make

Make install

验证:

Vim /etc/profile -> exportPATH=/usr/local/ruby/bin:$PATH ->source /etc/profile

[root@localhost ~]# ruby -v

ruby 2.0.0p481 (2014-05-08 revision 45883)[x86_64-linux]

 

  1. 3.      安装rubygem

tar -zxvf rubygems-2.4.1.tgz

ruby setup.rb

验证:

[root@localhost ~]# gem -v

2.4.1

 

  1. 4.      更换gem源,因为默认是美国的gem源,比较慢,好在中国淘宝有ruby.taobao.org

[root@localhost ~]# gem sources  --默认是这个,删除掉

*** CURRENT SOURCES ***

https://rubygems.org/

 

 

[root@localhost ~]# gem sources --remove https://rubygems.org/  --删除

https://rubygems.org/ removed from sources

 

 

[root@localhost ~]# gem sources -a https://ruby.taobao.org/      --添加

https://ruby.taobao.org/ added to sources

 

  1. 5.      安装rails 4.2.5  mongrel

gem install rails -v=4.2.5

gem install mongrel -v=1.2.0.pre2

 

 

  1. 6.      安装mysql(这里使用yum安装)

yum install -y mysql-server mysql mysql-devel

service mysqld start –启动mysql

 

  1. 7.      创建redmine数据库和用户

mysql> createdatabase redmine character set utf8;

mysql> createuser 'redmine'@'%' identified by 'redmine';

mysql> grantall privileges on redmine.* to 'redmine'@'%';

 

 

  1. 8.      安装httpd(我这里使用yum安装)

Yum install httpd httpd-devel

 

  1. 9.      下载redmine,并配置

tar -zxvf redmine-3.2.0.tar.gz -C/var/www/html/

cd /var/www/html/redmine

cp database.yml.example database.yml

vim database.yml

production:

  adapter: mysql2

  database: redmine

  host: localhost

  username: redmine

  password: "redmine"

 encoding: utf8

 

  1. 10.  配置会话(一般这里都会出现很多错误,不过都是依赖包的问题)


wKiom1amI72DJQXzAAAa4ku_lPQ828.png


如上显示没有找到这个gem包,使用bundle install(如果没有这个gem包,使用gem installbundle)

注意:使用bundle 安装默认是美国gem源我们要修改为淘宝的gem

[root@localhost redmine]# vim Gemfile

#source 'https://rubygems.org'     --注释掉

source'https://ruby.taobao.org'     --添加淘宝gem


接着再执行bundle install

wKiom1amI-nAyM1yAAB_7oZ5C-U704.png


  1. 11.      开始配置会话

rake generate_secret_token

 

  1. 12.      导入生成数据

rake db:migrate RAILS_ENV='production'

 

 

  1. 13.      启动redmine

ruby bin/railsserver webrick -e production -d -b 0.0.0.0 -p 8000

默认用户名密码都是 admin

然后检查端口8000

wKioL1amJHfSa_OzAABnMfSiKzE720.png


游览器访问http://192.168.10.30:8000

wKioL1amJKXQtxy5AADcYr2fMDM127.png