1:安装系统包和部分软件包
# yum -y install patch make gcc gcc-c++ gcc-g77 flex* bison file libtool libtool-libs libtool-ltdl-devel* autoconf kernel-devel automake libmcrypt* libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal nano sendmail fonts-chinese gettext gettext-devel gmp-devel pspell-devel readline* libxslt* pcre* net-snmp* gmp* libtidy* ImageMagick* subversion*
# yum update nss
2:安装MySQL,参考我的文章:
https://blog.csdn.net/feng820724/article/details/77446526
3:设置mysql的账号和密码,并创建redmine数据库
# mysql -uroot -p
mysql > create database redmine character set utf8;
mysql > create user 'redmine'@'localhost' IDENTIFIED BY 'redmine';
mysql > grant all privileges on redmine.* to 'redmine'@'localhost';
mysql > flush privileges;
4:安装rvm
# curl -L get.rvm.io | bash -s stable
如果遇到以下报错,则执行报错中的gpg2 --recv-keys的命令。
# gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# curl -L get.rvm.io | bash -s stable
# source /usr/local/rvm/scripts/rvm
# rvm -v
如果未显示rvm版本,重新安装一次
5:安装ruby
# rvm list known
# rvm install ruby-2.6.0-preview2
# gem -v
如果未显示版本,重新安装ruby
# gem source -l
# gem source --remove https://rubygems.org/
# gem source -a https://gems.ruby-china.com/
6:安装rails
# gem install rails
# gem install rake
# yum install mysql-devel
# gem install mysql2
7:下载redmine,配置redmine初始化并安装
# useradd -s /sbin/nologin redmine
# cd /usr/local/
# wget http://www.redmine.org/releases/redmine-3.4.4.tar.gz
# tar -zxvf redmine-3.4.4.tar.gz
# mv redmine-3.4.4 redmine && cd redmine
# chown -R root:root /usr/local/redmine
# cp config/database.yml.example config/database.yml
# cp config/configuration.yml.example config/configuration.yml
# vim config/database.yml
选择product部分修改数据库密码
# bundle install
# rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data
# mkdir -pv tmp tmp/pdf public/plugin_assets
# chown -R redmine:redmine files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
8:启动redmine
# bundle exec rails server webrick -e production -b 192.168.18.25