一、所需工具

ruby 2.6.8 devkit(x64)(两个一起安装)
下载地址 http://rubyinstaller.org/downloads/
redmine 4.2.2
下载地址 http://www.redmine.org/projects/redmine/wiki/Download
mysql 5.6.24

二、参考

Redmine windows 部署
windows下安装ruby,devkit

安装 ruby,devkit后,在cmd中输入ruby -v
如果找不到ruby,需要配置环境变量

在windows中配置环境变量
RUBY_HOME=rubyinstaller_dir (实际的ruby所在路径)
在path中添加 %RUBY_HOME%\bin
在命令行下运行 ruby --version,显示ruby版本信息。

三、踩坑

坑1:

ruby安装完成后,打开cmd命令行,在redmine路径下执行gem install bundler,不然会报找不到Gemfile文件错误。

坑2:

记得替换bundle的镜像源
bundle config mirror.https://rubygems.org https://mirrors.tuna.tsinghua.edu.cn/rubygems/

坑3

执行bundle exec rake generate_secret_token出错
提示信息

You’ve installed the binary version of mysql2.
It was built using MySQL Connector/C version 6.1.11.
It’s recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files were retrieved from:
http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.11-win32.zip
This gem includes vendor/libmysql.dll with redistribution notice in vendor/README.

解决方法:

1、按照提示,去http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.11-win32.zip
下载文件
2、gem uninstall mysql2

3、gem install mysql2 --platform=ruby -- '--with-mysql-lib="D:\mysql-connector-c-6.1.11-win32\lib" --with-mysql-include="D:\mysql-connector-c-6.1.11-win32\include"'目录修改为解压后对应的目录

4、gem list mysql2 查看下载的mysql版本
5、修改redmine目录下的gemfile.lock文件,mysql2 (版本信息) 的值修改为自己下载的mysql2版本
specs:下的 mysql2 (0.5.3-x64-mingw32)改为对应版本,我这里是mysql2 (0.5.3)

redmine版本要仔细查看官方文档

一定要仔细!!一定要仔细!!一定要仔细!!

踩了无数版本问题的坑。。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐