咨询QQ:2083503238、1684129674、480934277(请勿重复咨询) 咨询微信:qiangfans
redmine3.3迁移、升级、插件备忘录
- 2019-09-23 14:44:00
- testingbang
- 原创 1585 投稿得红包
点击链接加入QQ群229390571(全国招聘信息、免费公开课、视频应有尽有):https://jq.qq.com/?_wv=1027&k=5rbudQa 更多内容可以关注公众号:测试帮日记
服务现状
地址:http://xxxxx:3000
主要用到了redmine(rails)服务、mysql服务,还有些其他服务,都在这台机器上,请勿kill!
基础环境
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
yum -y install mysql-server mysql mysql-devel
安装rvm(参考:http://blog.csdn.net/mydo/article/details/47748211)
mkdir rvm
cd rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
gpg --verify rvm-installer.asc &&
curl -L https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable
bash rvm-installer stable
source /etc/profile.d/rvm.sh
rvm -v
sed -i -e 's/ftp.ruby-lang.org/pub/ruby/ruby.taobao.org/mirrors/ruby/g' /usr/local/rvm/config/db
sed -i -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
rvm list known #查看有哪些东东
rvm install 2.3
rvm 2.3 --default
ruby -v
gem -v
设置gem源(参考:https://ruby.taobao.org/)
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
gem sources -l
请确保只有 gems.ruby-china.org
gem install rails
ps:如果gem无法添加,可以修改vi /etc/resolv.conf,只保留nameserver 114.114.114.114,然后再次添加试试
rails -v
进入redmine的conf中,cp出来一个database.yml,然后修改production中的内容,参考下面的
production:
adapter: mysql2
database: redmine
host: localhost
username: root
password:
create database redmine character set utf8;
mysql -u root -p redmine < xxxx.sql
进入redmine的根目录执行下面的命令
gem install bundler
bundle install --without development test rmagick(如果此句总是超时,就修改redmine下的Gemfile为source 'https://ruby.taobao.org/')
bundle exec rake generate_secret_token
rake db:migrate RAILS_ENV=production
若有插件更新:bundle exec rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production rake db:migrate_plugins RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear
启动redmine3的命令:
bundle exec rails server webrick -e production -b 0.0.0.0 -d
linux防火墙屏蔽了端口3000
解决办法: 配置防火墙,开放宽口3000
# /sbin/iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
# /etc/rc.d/init.d/iptables save
# service iptables restart
redmine运行慢:
修改configuration.yml
找到 delivery_method: :smtp,将smtp改为async_smtp
重启服务。这里就是改成了异步
自定义菜单插件安装
解压zip并上传到redmine的plugins目录,插件如下
链接:https://pan.baidu.com/s/1m-5b_0Rf0zhtaWY6EyJhcw
提取码:3bgw
在redmine根目录下分别执行如下命令
git clone https://bitbucket.org/dkuk/a_common_libs.git
bundle install
rake redmine:plugins:migrate RAILS_ENV=production
之后重启redmine即可
最后在管理》插件中进行配置即可
统计图插件
redmine的插件目录执行:git clone https://github.com/masweetman/issue_charts.git
回到根目录执行:
bundle install
rake redmine:plugins:migrate RAILS_ENV=production
重启
图片预览插件
redmine的插件目录执行:git clone https://github.com/paginagmbh/redmine_lightbox2.git
回到根目录执行:rake redmine:plugins:migrate RAILS_ENV=production
插件的卸载
插件目录下执行:bundle exec rake redmine:plugins:migrate NAME=issue_charts VERSION=0 RAILS_ENV=production。
注意migrate NAME后面的名字一定是插件的名字)
删除插件文件
重启服务