欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

部署Ruby开发的基于web的项目管理软件redmine

程序员文章站 2022-05-19 23:26:39
...

前两天公司需要部署redmine,部署了一个,还挺费劲,在这儿做一下记录,以备后续使用

redmine介绍

 

yum -y install patch make gcc gcc-c++ gcc-g77 flex* bison file  
yum -y install libtool libtool-libs libtool-ltdl-devel* autoconf kernel-devel automake libmcrypt*  
yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel  
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel  
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel  
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs  
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel  
yum -y install openssl openssl-devel vim-minimal nano sendmail  
yum -y install fonts-chinese gettext gettext-devel  
yum -y install gmp-devel pspell-devel   
yum -y install readline* libxslt* pcre* net-snmp* gmp* libtidy*  
yum -y install ImageMagick* subversion*  

 

yum -y install mysql-server mysql-devel  

 

service mysqld start #启动mysql  
mysqladmin -u root -p password "test123" #创建root密码
mysql -uroot -p #输入密码登录
create database redmine character set utf8;  
create user 'redmine'@'localhost' IDENTIFIED BY 'pwd'; #用户名: redmine; 密码:pwd  
grant all privileges on redmine.* to 'redmine'@'localhost'; #最大权限  
flush privileges;  

 

\curl -L https://get.rvm.io | bash
source /etc/profile /usr/local/rvm/bin/rvm reload #设置环境变量并让其生效  
rvm -v #如果未显示rvm版本,重新安装一次  

 

rvm list known #最好不要安装2.0以下的版本  
rvm install ruby-1.9.3-p551 
gem -v #如果未显示版本,重新安装ruby  
rvm install ruby-1.9.3-p551 --create #重新安装ruby  
#如果安装2.0以上的版本,可能会创建账户不能编辑、项目不能创建等问题  
#redmine中的log记录为ActionView::Template::Error (undefined method `name' for nil:NilClass):

  

gem source -l # 查看当前镜像源  
gem source -r http://rubygems.org/  #删除原有gem的镜像源
gem sources -a https://ruby.taobao.org/ #新增gem的镜像源(确保只有ruby.taobao.org)  

 

vi /etc/profile
#在最下面加入一行
export PATH=$PATH:/usr/local/rvm/rubies/ruby-1.9.3-p551/bin

 

gem install rails  
gem install rake  
gem install mysql2 
gem install bundler

 

cd /usr/local/  
svn co http://svn.redmine.org/redmine/branches/2.3-stable  
mv 2.3-stable redmine  
cd redmine  
bundle install #重复执行,按照提示安装完缺少的组件

 

cd /usr/local/redmine/  
cp config/database.yml.example config/database.yml  
vim config/database.yml #选择product部分修改数据库密码  
rake generate_secret_token  
RAILS_ENV=production rake db:migrate #生成表结构  
RAILS_ENV=production rake redmine:load_default_data #初始化数据选择zh 

 

#命令行启动
ruby /usr/local/redmine/script/rails server webrick -e production
#守护进程启动
nohup ruby /usr/local/redmine/script/rails server webrick -e production &

 

访问 http://ip:3000/

默认账号和密码 admin admin