windows下借助InstantRails環境搭建redmine(轉)
由于項目需要,需要使用RedMine。
而RedMine在linux搭建教容易,同時,在windows2003下(不使用IIS)也教容易搭建,具體的安裝步驟,可以參考官方網址
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
我們搭建redmine使用集成環境Instantails。而Instantails官網這個程序最新的2.0版本07年以后就不再更新了,因此自己搭建前請根據自己的需求而選擇。而自身選擇集成,是因為教簡單,配置方便。
下載最新的InstantRails2.0:
http://rubyforge.org/projects/instantrails/
最新版的redmine 1.1.2:
http://rubyforge.org/frs/?group_id=1850
gem1.3.7版:
http://rubyforge.org/frs/download.php/70695/rubygems-update-1.3.7.gem
以下是配置InstantRails2.0與redmine的步驟,僅供參考:
1、解壓InstantRails2.0到一個文件夾,文件夾名字不能含有空格(如InstantRails即可)。
2、然后把redmine 1.1.2解壓到InstantRails下的rails_apps下。
注:這個就是ruby的項目文件夾。
3、把redmine的數據庫建立起來
-
進入“InstantRails/rails_apps/redmine/config"下,有文件“database.yml.example”,復制該文件重命名“database.yml”。
- 進入InstantRails根目錄下。點擊InstantRails.exe文件。此時啟動環境(Apache)的主程序了。
- InstantRails界面(就是剛點擊 InstantRails.exe后的程序界面)的I→Configure→Database (via PhpMyAdmin)”。
點擊InstantRails界面(就是剛點擊InstantRails.exe后的程序界面)的I→Rails Applications→Open Ruby Console Window欄目,然后會跳出dos窗口。在里面輸入命令:
- cd redmine
//進入redmin目錄 - rake db:migrate RAILS_ENV="production"
//創建數據庫
解決方法如下(如不行就在當前窗口下執行如下):
Successfully installed rubygems-update-1.3.7
1 gem installed
Installing ri documentation for rubygems-update-1.3.7...
Installing RDoc documentation for rubygems-update-1.3.7...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
-
gem install -v=0.4.2 i18n -
rake db:migrate RAILS_ENV="production"
注:運行rake db:migrate RAILS_ENV="production"可能會報如下錯誤:
A key is required to write a cookie containing the session data. Use config.acti
on_controller.session = { :key => "_myapp_session", :secret => "some secret phra
se" } in config/environment.rb
如果 還不行:請運行:
rake config/initializers/session_store.rb
-
//指明當前項目運行環境為production ,中間會提示選擇語言,選擇zh(中文)。rake redmine:load_default_data RAILS_ENV="production"
- rake db:migrate RAILS_ENV="development"
- rake redmine:load_default_data RAILS_ENV="development"
libmySQL.dll下載地址:
http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
把libmySQL.dll復制到 Instantails/Ruby/bin/目錄下(你安裝rubyinstaller的目錄Instantails)
基本上到此就OK了。
如想修改redmine的端口(默認需要http://localhost:3000方可訪問)
- 在I→configure→Apache 打開配置文件,搜索文件,將80的地方通通改為8080(其實就兩個地方)。
- 在I→Rails Applications→Manage Rails Applications里,選中redmine,然后點擊有個configure startup mode里,將端口配置為80。
- 然后點Start with Mongrel,在瀏覽器中輸入http://localhost則可以看到redmine首頁。
- 用戶名:admin 密碼:admin
- 可以看到成功登陸后臺

浙公網安備 33010602011771號