9

redmine安装步骤精编

 3 years ago
source link: https://www.meirenji.info/2018/10/25/redmine%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4%E7%B2%BE%E7%BC%96/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

redmine安装步骤精编

发表于 2018-10-25

| 分类于 善用佳软

| 0 Comments

运行环境:

mysql 5.5.56

mysql:root: ere20180625d

php 7.1.7

服务器(CentOS6.8)

redmine3.3.3.stable

Ruby2.3.3

Rails4.2.7.1

下面的安装过程,假定已经安装好了LNMP环境

安装开发工具

yum groupinstall "Development tools"

清理已安装过的

yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs
yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel
  1. 安装RVM
curl -sSL https://rvm.io/mpapis.asc | gpg --import

安装rvm

curl -L https://get.rvm.io | bash -s stable
  1. 安装ruby

刚开始用命令yum install ruby安装,但是是2.0以下的版本。

http://www.ruby-lang.org/en/downloads/下载你需要的版本,把安装包上传到指定目录,并解压

wget –no-check-certificate https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.gz

命令:tar zxvf ruby-2.3.6.tar.gz;解压后,进入ruby-2.3.6目录下,依次执行下面命令

命令:./configure

命令:make

命令:make install
  1. 查看ruby信息
ruby -v
  1. 安装rails 4.2
gem install rails -v=4.2

Ruby on Rails(官方简称为Rails,亦被简称为RoR),是一个使用Ruby语言写的开源Web應用框架,它是严格按照MVC结构开发的。 它努力使自身保持简单,来使实际的应用开发时的代码更少,使用最少的配置。

gem install rails --no-document -v='4.2.7'
  1. 下载redmine,解压并进入目录.安装管理ruby的包依赖的工具bundler
gem install bundler #注意是在网站根目录下执行

安装redmine依赖的所有ruby包

bundle install --without development test rmagick #完成redmine依赖包的安装
  1. 为Rails生成cookies秘钥
rake generate_secret_token
  1. 安装redmine

创建redmine数据库,添加mysql用户,配置Redmine的database.yml

SHOW databases;

CREATE DATABASE redmine;

use redmine;

CREATE USER 'redmineAdmin'@'localhost' IDENTIFIED BY 'adminedd2018062532';

grant all privileges ON redmine.* TO 'redmineAdmin'@'localhost' IDENTIFIED BY 'adminedd2018062532';

mysqldump -u redmineAdmin -p adminedd2018062532 redmine > redmine_backup0627.sql
cp config/database.yml.example config/database.yml
cat database.yum #修改对应数据库连接信息
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "my_password"
encoding: utf8
RAILS_ENV=production bundle exec rake db:migrate    #生成表结构,创建数据库结构

RAILS_ENV=production bundle exec rake redmine:load_default_data # 初始化数据选择zh,生成缺省数据
  1. 在WEBrick服务上测试Redmine是否安装成功
bundle exec rails server webrick -e production -b xx.xxx.xx.xx
  1. 配置Redmine在Nginx上运行

安装passenger

gem install passenger
passenger-install-nginx-module

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决方法 在这里


Redmine Internal error

bundle exec rails server webrick -e production -b 0.0.0.0

/sbin/iptables -I INPUT -p tcp –dport 3000 -j ACCEPT


find / -name php.ini

tail -f production.log


报错,这个报错很奇葩,会导致浏览的时候,报500错误。

Error: unknown attribute 'issues_visibility' for Role. Default configuration data was not loaded

解决方法:

我做了如下处理后得到解决:

  1. 把数据库中redmine库的字符集从原来设置的utf8mb4改为utf8;

  2. 把redmine库里自动生成的表全部清空,重新生成。这里用了个批理删除方法:

  3. 再运行下面命令重新初始化redmine库。

这次成功执行。

报错调试方法 原文传送

ERROR: Failed to build gem native extension

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.

解决方法:

原文传送
运行

bundle config --global silence_root_warning 1

DROP USER 'redmineAdmin'@'localhost';


wget http://www.redmine.org/releases/redmine-3.3.3.tar.gz


source /etc/profile.d/rvm.sh


rvm 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


rvmsudo 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

新建用户redmine

mkdir -p /home/redmine

useradd -d /home/redmine -m redmine

useradd -d /usr/lredmine -m lredmine

passwd lredmine:

2lredmine625sd@

给予redmine用户sudo权限:不然后面执行 bundle install会报错 could not locate gemfile redmine

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. gem install rmagick -v ‘2.16.0’

su lredmine

/root/redmine-3.3.3

bundle install –without development test rmagick 替换 undle install命令。不然会报错,通不过。

ERROR: Failed to build gem native extension


大家都在用哪些Redmine插件呢?

推荐一些自己用过,而且觉得还不错的(全部支持3.3.x 版本):

插件安装更新命令:

rake redmine:plugins:migrate RAILS_ENV=production

大家都在用哪些Redmine插件呢?

redmine-1.2.2安装截图粘贴插件

Redmine Checklists plugin: redmine_checklists-3_1_11-light

Redmine Checklists plugin (Light version) 编辑器增强

Redmine CKEditor plugin会在每个issue下面增加一个check list 超好用,当任务至最小层次的时候,这个插件很好用。

ckeditor插件,高级功能插件

Uninstall plug

  • Change the text formatting (Administration > Settings > General > Text formatting) to textile

  • Rollback the migration

rake redmine:plugins:migrate  NAME=redmine_ckeditor VERSION=0 RAILS_ENV=production
  • Delete the plugin directory (plugins/redmine_ckeditor)
[root@li1830-25 redmine-3.3.3]# rake -T emoji
rake emoji # Copy emoji to the Rails `public/images/emoji` directory
Could not find rmagick-2.16.0 in any of the sources

Run `bundle install` to install missing gems.
yum install ImageMagick
Gems in the groups development, test and rmagick were not installed.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK