一、准备工具
- redmine包,官网下载redmine-3.4.2.zip
- railsinstaller,官网下载railsinstaller-3.3.0.exe
二、安装
参照官方介绍http://www.redmine.org/projects/redmine/wiki/RedmineInstall
安装railsinstaller-3.3.0.exe,解压redmine-3.4.2.zip到Sites目录下(默认在系统盘C:\下)
创建空数据库和用于访问redmine数据库的用户
MySql5.7.18
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';配置数据库连接
拷贝config/database.yml.example到config/database.yml,打开做以下修改
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
port: 3306
password: redmine
encoding: utf8安装依赖
切到解压后的redmine目录,按顺序执行命令
gem install bundler
bundle install --without development test
会话加密存储
bundle exec rake generate_secret_token
如果提示“系统找不到指定的路径”,请尝试执行gem install rake,再进行该步骤
数据库初始化
set RAILS_ENV=production
bundle exec rake db:migrate 注意:官方中是bundle exec rails db:migrate,但当前版应该改为rake
默认数据
set RAILS_ENV=production
set REDMINE_LANG=zh
bundle exec rake redmine:load_default_datawindows可以跳过
启动服务测试安装是否成功
bundle exec rails server webrick -e production
默认地址是:http://localhost:3000
由于rails默认绑定localhost,可以修改启动命令 rails server -e production -b 0.0.0.0 -p 8000,这样其他机子可以使用http://本机ip:8000访问,且指定为production
登录
默认管理员账户登录,用户名:admin,密码:admin,首次登录会提示修改密码
三、配置
拷贝config/configuration.yml.example到config/configuration.yml,配置后记得重启生效
邮件(163为例)
delivery_method: :smtp
smtp_settings:
address: smtp.163.com
port: 465
ssl: true
enable_starttls_auto: true
authentication: :login
domain: 163.com
user_name: 邮箱地址
password: 邮箱密码
版本库
将git之类的加到环境变量就行了,redmine项目中具体配置后面介绍
待续
注:
在windows server 2008上安装时,可能遇到以下问题:
1. An error occurred while installing rmagick (2.16.0), and Bundler cannot
continue.
打开Gemfile将44行处rmagick相关先注掉(暂时还没解决这个问题)
2. Failed to load libmysql.dll from C:\RailsInstaller\Ruby2.3.0\lib\ruby\gems\2.3.0\gems\mysql2-0.4.8-x86-mingw32\vendor\libmysql.dll
1)先卸载 gem uninstall mysql2
执行
gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\RailsInstaller\mysql-connector-c-noinstall-6.0.2-winx64\lib" --with-mysql-include="C:\RailsInstaller\mysql-connector-c-noinstall-6.0.2-winx64\include"'