Redmine的安装【Windows】【1.0.4】

作者: harde 分类: 计算机 发布时间: 2010-12-16 14:32

本文参考http://redmine.ossxp.com/redmine/documents/10书写,以便备忘。

Redmine是一个灵活的跨平台的项目管理与缺陷跟踪管理工具。下面介绍一下Windows下Redmine的安装步骤。
1Redmine是基于Ruby On Rails的,首先需要给电脑安装Ruby运行环境
1. Rubyinstaller
下载:http://rubyforge.org/frs/?group_id=167&release_id=42563

安装完rubyinstaller后, 点击开始菜单,选择 Start Command Prompt with Ruby
进入含有ruby环境的CMD界面,依次执行如下命令:
gem install rake
gem install -v=1.0.1 rack
gem install mysql
gem install -v=2.3.5 rails

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

C:\Users\Harde>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7…
Installing RDoc documentation for rake-0.8.7…

C:\Users\Harde>gem install -v=1.0.1 rack
Successfully installed rack-1.0.1
1 gem installed
Installing ri documentation for rack-1.0.1…
Installing RDoc documentation for rack-1.0.1…

C:\Users\Harde>gem install mysql
Successfully installed mysql-2.8.1-x86-mingw32
1 gem installed
Installing ri documentation for mysql-2.8.1-x86-mingw32…
Installing RDoc documentation for mysql-2.8.1-x86-mingw32…

C:\Users\Harde>gem install -v=2.3.5 rails
Successfully installed activesupport-2.3.5
Successfully installed activerecord-2.3.5
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Successfully installed activeresource-2.3.5
Successfully installed rails-2.3.5
6 gems installed
Installing ri documentation for activesupport-2.3.5…
Installing ri documentation for activerecord-2.3.5…
Installing ri documentation for actionpack-2.3.5…
Installing ri documentation for actionmailer-2.3.5…
Installing ri documentation for activeresource-2.3.5…
Installing ri documentation for rails-2.3.5…
Installing RDoc documentation for activesupport-2.3.5…
Installing RDoc documentation for activerecord-2.3.5…
Installing RDoc documentation for actionpack-2.3.5…
Installing RDoc documentation for actionmailer-2.3.5…
Installing RDoc documentation for activeresource-2.3.5…
Installing RDoc documentation for rails-2.3.5…

2安装MySQL数据库
下载:http://dev.mysql.com/downloads/mysql/
安装过程不赘述
安装完后,启动CMD,切换进MySQL的bin目录,登录MySQL,依次输入以下语句
create database redmine character set utf8;
create user ‘redmine’@’localhost’ identified by ‘redmine’;
grant all privileges on redmine.* to ‘redmine’@’localhost’;

D:\MySQL\MySQL Server 5.5\bin>mysql -u root -p
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.5.8 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> create database redmine character set utf8;
Query OK, 1 row affected (0.02 sec)

mysql> create user ‘redmine’@’localhost’ identified by ‘redmine’;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on redmine.* to ‘redmine’@’localhost’;
Query OK, 0 rows affected (0.00 sec)

3下载Remine,解压到任意目录
进入目录找到config文件夹下的database.yml.example
复制一份,并重命名为database.yml
用记事本打开,修改
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
中的username与password与mysql一致

注意:冒号与值之间要有一个半角空格

4再次打开Start Command Prompt with Ruby
依次输入,切换到redmine目录依次输入
set RAILS_ENV=production
rake config/initializers/session_store.rb
rake db:migrate
rake redmine:load_default_data

注意如果在rake config/initializers/session_store.rb发生异常
D:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path’: can’t find executable r
ake for rake-0.8.7 (Gem::Exception)
from D:/Ruby192/bin/rake:19:in `


请进入Ruby安装安装目录下的lib\ruby\gems\1.9.1\specifications
找到rake.gemspec文件删除
比如Harde就删除了D:\Ruby192\lib\ruby\gems\1.9.1\specifications\rake.gemspec

如果在第三步时,没有按照harde所说添加空格~,那么在rake db:migrate时,你又要悲剧了

如果出现以下异常:
Mysql::Error: query: not connected: CREATE TABLE ‘schema_migrations’ (‘version varchar(255) NOT NULL) ENGINE=InnoDB
或提示“缺少libmySQL.dll”或出现“126: 找不到指定的模块。 – D:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-
mingw32/lib/1.9/mysql_api.so”

说明需要添加MySQL的动态链接库文件 libmySQL.dll
下载地址 http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
然后把libmySQL.dll复制到 Ruby/bin/目录下(你安装rubyinstaller的目录)

日志太多,不贴了~

5好了~
下面这个代码区域,你不展开会郁闷,展开了会骂娘,自己决定~
[cmd” colla=”- ]
告诉你一件事,如果你下载的是最新的1.9版本的ruby,卸载~重新来过~….(Mysql不用动)
http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe
[/cmd” colla=”-]

成功执行:
会出现
Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fi, fr, gl, he,
hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, s
r, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
输入zh完成

最后输入ruby script/serve
启动Webrick服务器
出现以下字样就大功告成了

D:\redmine-1.0.4>ruby script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
./script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warn
ing: Gem::Dependency#version_requirements is deprecated and will be removed on o
r after August 2010. Use #requirement
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-12-16 14:30:00] INFO WEBrick 1.3.1
[2010-12-16 14:30:00] INFO ruby 1.8.7 (2010-08-16) [i386-mingw32]
[2010-12-16 14:30:00] INFO WEBrick::HTTPServer#start: pid=3620 port=3000

现在打开浏览器,输入http://localhost:3000看看吧~

写在后面的:
为了方便,我们可以把WEBrick添加为服务,以便启动
打开Start Command Prompt with Ruby
输入gem install mongrel_service
完成后输入mongrel_rails service::install -N RedMine -c D:\redmine-1.0.4 -p 3000 –e production;
注意:D:\redmine-1.0.4是具体的目录,请根据实际情况修改;
安装服务后,查看-e后的参数是不是production,如果不是production而是development,则在注册表中把参数手动改为production即可,修改方法是:在“开始→运行”中键入“regedit”,打开“注册表编辑器”,展开分支“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RedMine”,右侧窗格中显示的就是服务的详细参数。
找到Start项,把值改为2(也可以手动打开服务,把启动类型改为自动)
找到ImagePath项,看一下e后是否production,不是的话修改一下,是的话关闭退出
OK~在cmd里输入net start redmine就可以启动服务了
以后服务会自动启动的~
以后不想用了
可以输入
mongrel_rails service::remove -N RedMine
删除服务
为了备忘,您可以选择把此文添加收藏

⬆️⬆️⬆️不要钱、不用登录、没有广告⬆️⬆️⬆️


如果文章对您有帮助,请至少点下⬆️⬆️⬆️上面⬆️⬆️⬆️的赞,您的鼓励是对我创作的最大支持。
如果没能帮到您,那么很遗憾,如果方便的话,还请在评论区告诉我为什么,谢谢。

⬇️⬇️⬇️下面这个要钱⬇️⬇️⬇️

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注