前提安装redmine ruby环境版本要求:
1. 安装依赖关系
yum install zlib*
yum install openssl*
yum install ImageMagick-devel –y
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]
3. 安装rubygem
tar -zxvf rubygems-2.4.1.tgz
ruby setup.rb
验证:
[root@localhost ~]# gem -v
2.4.1
4. 更换gem源,因为默认是美国的gem源,比较慢,好在中国淘宝有ruby.taobao.org
[root@localhost ~]# gem sources --默认是这个,删除掉
*** CURRENT SOURCES ***
[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
5. 安装rails 4.2.5 mongrel
gem install rails -v=4.2.5
gem install mongrel -v=1.2.0.pre2
6. 安装mysql(这里使用yum安装)
yum install -y mysql-server mysql mysql-devel
service mysqld start –启动mysql
7. 创建redmine数据库和用户
mysql> createdatabase redmine character set utf8;
mysql> createuser 'redmine'@'%' identified by 'redmine';
mysql> grantall privileges on redmine.* to 'redmine'@'%';
8. 安装httpd(我这里使用yum安装)
Yum install httpd httpd-devel
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
10. 配置会话(一般这里都会出现很多错误,不过都是依赖包的问题)
如上显示没有找到这个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
11. 开始配置会话
rake generate_secret_token
12. 导入生成数据
rake db:migrate RAILS_ENV='production'
13. 启动redmine
ruby bin/railsserver webrick -e production -d -b 0.0.0.0 -p 8000
默认用户名密码都是 admin
然后检查端口8000:
游览器访问:http://192.168.10.30:8000
转载于:https://blog.51cto.com/gloryxin/1738446