win7下安装redmine2.3.2

来源:互联网 发布:淘宝 旧版本 ipad 编辑:程序博客网 时间:2024/05/16 09:11



环境:
Win7 64位&32位 
Mysql5.6
Railsinstaller3.0.0
Redmine2.3.2

参考资料
官网安装指南
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
gem install mysql2 错误解决
http://rubyer.me/blog/138/
64位下gem install mysql2错误解决
http://www.redmine.org/boards/1/topics/32693
需要rmagick的可以看
http://www.redmine.org/projects/ ... gick_gem_on_Windows


下载地址
MySQL
http://dev.mysql.com/downloads/windows/installer/
redmine
http://rubyforge.org/frs/?group_id=1850
railsinstaller
http://rubyforge.org/frs/?group_id=5288
mysql-connector-c的32位版本(32位系统不需要):
http://dev.mysql.com/downloads/connector/c/

第一步: 
安装mysql5.6,如果没安装Net4.0会提示你安装的 ,官网下mysql的自带VC2008,full安装。
安装完成后执行下面的SQL
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';

第二步:
解压redmine后进入X:\redmine-2.3.2\config,复制database.yml.example到当前目录并重命名为database.yml,记事本打开修改为以下内容
注:默认使用ipv6的比如win7不要使用localhost,官网指南中有说明

production:
  adapter: mysql2
  database: redmine
  host: 127.0.0.1
  username: redmine
  password: "my_password"
  encoding: utf8

第三步:
安装railsinstaller,railsinstaller包含了ruby、devkit和rails,组件兼容会比较少。
安装完后打开Command Prompt with Ruby and Rails,配置git用户邮箱,可以不使用所以随便填也可以。
然后定位到redmine根目录,下面的命令需要联网,ruby服务器不稳定,貌似还被墙了,如果连接超时进度不走什么的,关掉防火墙,设成google的dns- 8.8.8.8,会好一些。
执行
1、gem install bundler
2、gem install mysql2 -- '--with-mysql-dir="C:\Program Files\MySQL\MySQLServer 5.6"'
3、bundle install --without development test rmagick

64位系统下第二条命令不同,目录需要指向mysql-connector-c,
比如
gem install mysql2 -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Server 5.6\mysql-connector-c-6.1.1-win32"'
如果还是报错,重启系统试一试,从找的资料来看是不需要的,不过我是重启了虚拟机才能安上。

如果执行第三条命令的过程中提示某些组件安装失败,有如下提示:
…… 
Make sure that `gem install coderay -v '1.0.9'` succeeds before bundling.

那就先执行
gem install coderay -v '1.0.9'
然后再执行
bundle install --without development test rmagick

第四步:
32位:
把C:\Program Files\MySQL\MySQL Server 5.6\lib\libmysql.dll拷贝到C:\RailsInstaller\Ruby2.0.0\bin
64位:
把C:\Program Files\MySQL\MySQL Server 5.6\mysql-connector-c-6.1.1-win32\lib\libmysql.dll拷贝到C:\RailsInstaller\Ruby2.0.0\bin

第五步:
执行下面命令
rake generate_secret_token
set RAILS_ENV=production
rake db:migrate
set RAILS_ENV=production
set REDMINE_LANG=zh
rake redmine:load_default_data

第六步:
执行下面命令启动服务
ruby script/rails server webrick -e production
浏览http://localhost:3000/
0 0
原创粉丝点击