Redmine 安裝記錄

Redmine 安裝記錄

Requirements

本文用到的系統(tǒng)為64位的 Windows, 使用的數(shù)據(jù)庫為SQL Server 2012莉撇。
安裝過程中全程翻墻,未使用國內(nèi)鏡像。國內(nèi)鏡像可能會有的包找不到。

  1. 安裝Redmine支持的最高Ruby 版本2.3:rubyinstaller-2.3.3-x64.exe域慷。安裝時勾選:Install Tcl/Tk supportAdd Ruby executables to your PATH
  2. gem 升級:
    gem update --system # 可能需要翻墻
    gem -v
    2.6.11
  1. 安裝Redmine支持的最高Rails 版本4.2:
gem install rails -v 4.2.5
``` 
4. 安裝SQL Server 2012: SQLEXPRADV_x64_CHS.exe
5. 安裝DevKit: DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe, 下載地址:http://rubyinstaller.org/downloads/
    1. 解壓到某一目錄,如:D:/devkit
    2. cd D:/devkit
    3. ruby dk.rb init
    4. 查看該目錄下的config.yml里的內(nèi)容是否紙箱ruby安裝目錄
    5. ruby dk.rb install設(shè)置完成

### 安裝步驟

#### Step 1 Redmine application
下載Readmine 程序:http://www.redmine.org/projects/redmine/wiki/Download犹褒。

解壓到系統(tǒng)目錄抵窒,我這里是:E:\www\redmine-3.3.2

#### Step2 創(chuàng)建數(shù)據(jù)庫和用戶

Redmine database user will be named redmine hereafter but it can be changed to anything else.

** SQL Server** 
The database, login and user can be created within SQL Server Management Studio with a few clicks.

If you prefer the command line option with SQLCMD, here's some basic example:

USE [master]
GO

-- Very basic DB creation
CREATE DATABASE [REDMINE]
GO

-- Creation of a login with SQL Server login/password authentication and no password expiration policy
CREATE LOGIN [REDMINE] WITH PASSWORD=N'redminepassword', DEFAULT_DATABASE=[REDMINE], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

-- User creation using previously created login authentication
USE [REDMINE]
GO
CREATE USER [REDMINE] FOR LOGIN [REDMINE]
GO
-- User permissions set via roles
EXEC sp_addrolemember N'db_datareader', N'REDMINE'
GO
EXEC sp_addrolemember N'db_datawriter', N'REDMINE'
GO
EXEC sp_addrolemember N'db_owner', N'REDMINE' # 不加這個,后面會沒有權(quán)限創(chuàng)建表
GO


#### Step 3 - 數(shù)據(jù)庫連接和配置

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.

Example for a SQL Server database (default host localhost, default port 1433):

production:
adapter: sqlserver
database: redmine
username: redmine # should match the database user name
password: redminepassword # should match the login password

development:
adapter: sqlserver
database: redmine
username: redmine
password: redminepassword

test:
adapter: sqlserver
database: redmine
username: redmine
password: redminepassword


#### Step 4 - 安裝依賴項

Redmine uses Bundler to manage gems dependencies.

You need to install Bundler first:

gem install bundler


Then you can install all the gems required by Redmine using the following command:

bundle install --without development test


安裝過程中出現(xiàn)錯誤:
**An error occurred while installing rmagick (2.16.0), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.16.0'` succeeds before bundling.**
**解決辦法**:
安裝ImageMagic 安裝包:“ImageMagick-7.0.5-2-Q16-x64-dll”:
![Uploading imagemagick-setup_789438.gif . . .]

安裝完后叠骑,readmine目錄下打開一個新的命令行李皇。

set CPATH=C:\Program Files\ImageMagick-7.0.5-Q16\include
set LIBRARY_PATH=set LIBRARY_PATH=C:\Program Files\ImageMagick-7.0.5-Q16\lib

參考:http://www.redmine.org/projects/redmine/wiki/HowTo_install_rmagick_gem_on_Windows



#### Step 5 - 生成對話存儲加密

This step generates a random key used by Rails to encode cookies storing session data thus preventing their tampering.
Generating a new secret token invalidates all existing sessions after restart.

* with Redmine 2.x:

bundle exec rake generate_secret_token

Alternatively, you can store this secret in config/secrets.yml:
http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml

#### Step 6 - Database schema objects creation

Create the database structure, by running the following command under the application root directory:

RAILS_ENV=production bundle exec rake db:migrate


Windows syntax:

set RAILS_ENV=production
bundle exec rake db:migrate


It will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

1. 中間出現(xiàn)**錯誤**:
  - 錯誤描述

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
rake aborted!
LoadError: cannot load such file -- tiny_tds/tiny_tds
E:/www/redmine-3.3.2/config/application.rb:5:in <top (required)>' E:/www/redmine-3.3.2/Rakefile:5:inrequire'
E:/www/redmine-3.3.2/Rakefile:5:in <top (required)>' LoadError: cannot load such file -- tiny_tds/2.3/tiny_tds E:/www/redmine-3.3.2/config/application.rb:5:in<top (required)>'
E:/www/redmine-3.3.2/Rakefile:5:in require' E:/www/redmine-3.3.2/Rakefile:5:in<top (required)>'
(See full trace by running task with --trace)

  - 錯誤解決:
更改tiny_tds 的版本為最新,更改文件:Gemfile

when /sqlserver/
gem "tiny_tds", "~> 0.6.2", :platforms => [:mri, :mingw, :x64_mingw]
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw, :x64_mingw]

改為

when /sqlserver/
gem "tiny_tds", "~> 1.3.0", :platforms => [:mri, :mingw, :x64_mingw]
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw, :x64_mingw]


2. 中間出現(xiàn)錯誤:
  - 錯誤描述:

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
rake aborted!
ArgumentError: missing :host option if no :dataserver given
E:/www/redmine-3.3.2/app/models/custom_field.rb:37:in <class:CustomField>' E:/www/redmine-3.3.2/app/models/custom_field.rb:18:in<top (required)>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:90:in field_attributes' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:93:in<class:Base>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:50:in <module:FieldFormat>' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:21:in<module:Redmine>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:20:in <top (required)>' E:/www/redmine-3.3.2/lib/redmine.rb:40:in<top (required)>'
E:/www/redmine-3.3.2/config/initializers/30-redmine.rb:6:in <top (required)>' E:/www/redmine-3.3.2/config/environment.rb:14:in<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

  - 錯誤解決:
數(shù)據(jù)庫配置文件config/database.yml 中添加

host: 127.0.0.1
port: 1433

全部的:

production:
adapter: sqlserver
database: redmine
username: redmine
password: redminepassword
host: 127.0.0.1
port: 1433


3. 出現(xiàn)錯誤:
  - 錯誤現(xiàn)象:

E:\www\redmine-3.3.2>bundle exec rake db:migrate
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
rake aborted!
TinyTds::Error: Unable to connect: Adaptive Server is unavailable or does not exist (127.0.0.1:1433)
E:/www/redmine-3.3.2/app/models/custom_field.rb:37:in <class:CustomField>' E:/www/redmine-3.3.2/app/models/custom_field.rb:18:in<top (required)>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:90:in field_attributes' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:93:in<class:Base>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:50:in <module:FieldFormat>' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:21:in<module:Redmine>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:20:in <top (required)>' E:/www/redmine-3.3.2/lib/redmine.rb:40:in<top (required)>'
E:/www/redmine-3.3.2/config/initializers/30-redmine.rb:6:in <top (required)>' E:/www/redmine-3.3.2/config/environment.rb:14:in<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

  - 解決辦法:
在SQL Server  中啟用1433 端口宙枷。**Sql Server Configuration Manager(SQL Server 配置管理器)** -> **SQL Server 網(wǎng)路配置**-> **SQLEXPRESS 的協(xié)議** -> ** TCP/IP **

    參考:https://msdn.microsoft.com/zh-cn/library/ms177440.aspx

4. 出現(xiàn)錯誤:
  - 錯誤現(xiàn)象:

E:\www\redmine-3.3.2>bundle exec rake db:migrate
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
rake aborted!
TinyTds::Error: 用戶 'redmine' 登錄失敗疙赠。
E:/www/redmine-3.3.2/app/models/custom_field.rb:37:in <class:CustomField>' E:/www/redmine-3.3.2/app/models/custom_field.rb:18:in<top (required)>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:90:in field_attributes' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:93:in<class:Base>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:50:in <module:FieldFormat>' E:/www/redmine-3.3.2/lib/redmine/field_format.rb:21:in<module:Redmine>'
E:/www/redmine-3.3.2/lib/redmine/field_format.rb:20:in <top (required)>' E:/www/redmine-3.3.2/lib/redmine.rb:40:in<top (required)>'
E:/www/redmine-3.3.2/config/initializers/30-redmine.rb:6:in <top (required)>' E:/www/redmine-3.3.2/config/environment.rb:14:in<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

  - 解決辦法:
    - **SQL Server 配置管理器** 中的**SQL Server 網(wǎng)絡(luò)配置**中啟用**Named Pipes**
    - 更改服務(wù)器身份驗證策略為**SQL Server 和 Windows 身份驗證模式**:Micorsoft SQL Server Management Studio => 左邊欄的服務(wù)器上單擊鼠標右鍵,選擇屬性=>**安全性**:
![auth_check.png](http://upload-images.jianshu.io/upload_images/1237436-495134e518f0d2e4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
, 重啟服務(wù)器朦拖。
  - 參考:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b9864938-3b9d-46ed-913c-1014d93738d5/microsoft-sql-server-error233?forum=sqldatabaseengine

5. 出現(xiàn)錯誤:

E:\www\redmine-3.3.2>bundle exec rake db:migrate
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
rake aborted!
ActiveRecord::StatementInvalid: TinyTds::Error: CREATE TABLE permission denied in database 'REDMINE'.: CREATE TABLE [schema_migrations] ([version] nvarchar(4000) NOT NULL)
TinyTds::Error: CREATE TABLE permission denied in database 'REDMINE'.
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

  - 解決辦法:in sql management studio

USE [REDMINE]
GO
EXEC Sp_droprolemember N'db_datareader', N'REDMINE'
GO
EXEC Sp_droprolemember N'db_datawriter', N'REDMINE'
GO
EXEC sp_addrolemember N'db_owner', N'REDMINE'
GO



6. 出現(xiàn)錯誤:

== 20160404080304 ForcePasswordResetDuringSetup: migrating ====================
== 20160404080304 ForcePasswordResetDuringSetup: migrated (0.0055s) ===========
== 20160416072926 RemovePositionDefaults: migrating ===========================
-- change_column("boards", :position, :integer, {:default=>nil})
-> 0.0220s
-- change_column("custom_fields", :position, :integer, {:default=>nil})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
undefined method type' for nil:NilClass E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:4:inblock in up'
E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:3:in each' E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:3:inup'
C:in migrate' NoMethodError: undefined methodtype' for nil:NilClass
E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:4:in block in up' E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:3:ineach'
E:/www/redmine-3.3.2/db/migrate/20160416072926_remove_position_defaults.rb:3:in up' C:inmigrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

  - 解決辦法:再次運行出錯命令圃阳。

#### Step 7 - 數(shù)據(jù)庫默認數(shù)據(jù)集
Insert default configuration data in database, by running the following command:

RAILS_ENV=production bundle exec rake redmine:load_default_data

Redmine will prompt you for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task.

E.g.:

Unices:

RAILS_ENV=production REDMINE_LANG=fr bundle exec rake redmine:load_default_data

Windows:

set RAILS_ENV=production
set REDMINE_LANG=zh
bundle exec rake redmine:load_default_data


#### Step 8 - 文件系統(tǒng)權(quán)限

Windows 系統(tǒng)可勝率此步驟。

#### Step9 - 測試安裝是否成功

Test the installation by running WEBrick web server:
- with Redmine 3.x:

bundle exec rails server webrick -e production


Once WEBrick has started, point your browser to http://localhost:3000/. You should now see the application welcome page.

#### Step 10 - 登錄
Use default administrator account to log in:

- login: admin
- password: admin
You can go to Administration menu and choose Settings to modify most of the application settings.

#### 配置

Redmine settings are defined in a file named *config/configuration.yml.*

If you need to override default application settings, simply copy config/configuration.yml.example to config/configuration.yml and edit the new file; the file is well commented by itself, so you should have a look at it.

These settings may be defined per Rails environment (production/development/test).

Important : don't forget to restart the application after any change.

#### 安裝折騰記錄

* 2017-3-19:Redmine 3.3 怎么裝也裝不上璧帝,試試3.2捍岳, 3.2 需要的Ruby 支持的Ruby 最高版本是2.2。
* 2017-3-19 16:50:23 :發(fā)現(xiàn)rmagick 問題可以解決睬隶,又開始在Win10上嘗試Ruby 3.3锣夹。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市苏潜,隨后出現(xiàn)的幾起案子银萍,更是在濱河造成了極大的恐慌,老刑警劉巖恤左,帶你破解...
    沈念sama閱讀 216,470評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件贴唇,死亡現(xiàn)場離奇詭異,居然都是意外死亡飞袋,警方通過查閱死者的電腦和手機戳气,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,393評論 3 392
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來巧鸭,“玉大人瓶您,你說我怎么就攤上這事「偃裕” “怎么了呀袱?”我有些...
    開封第一講書人閱讀 162,577評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長郑叠。 經(jīng)常有香客問我夜赵,道長,這世上最難降的妖魔是什么锻拘? 我笑而不...
    開封第一講書人閱讀 58,176評論 1 292
  • 正文 為了忘掉前任油吭,我火速辦了婚禮击蹲,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘婉宰。我一直安慰自己歌豺,他們只是感情好,可當我...
    茶點故事閱讀 67,189評論 6 388
  • 文/花漫 我一把揭開白布心包。 她就那樣靜靜地躺著类咧,像睡著了一般。 火紅的嫁衣襯著肌膚如雪蟹腾。 梳的紋絲不亂的頭發(fā)上痕惋,一...
    開封第一講書人閱讀 51,155評論 1 299
  • 那天,我揣著相機與錄音娃殖,去河邊找鬼值戳。 笑死,一個胖子當著我的面吹牛炉爆,可吹牛的內(nèi)容都是我干的堕虹。 我是一名探鬼主播,決...
    沈念sama閱讀 40,041評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼芬首,長吁一口氣:“原來是場噩夢啊……” “哼赴捞!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起郁稍,我...
    開封第一講書人閱讀 38,903評論 0 274
  • 序言:老撾萬榮一對情侶失蹤赦政,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后耀怜,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體恢着,經(jīng)...
    沈念sama閱讀 45,319評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,539評論 2 332
  • 正文 我和宋清朗相戀三年封寞,在試婚紗的時候發(fā)現(xiàn)自己被綠了然评。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,703評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡狈究,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出盏求,到底是詐尸還是另有隱情抖锥,我是刑警寧澤,帶...
    沈念sama閱讀 35,417評論 5 343
  • 正文 年R本政府宣布碎罚,位于F島的核電站磅废,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏荆烈。R本人自食惡果不足惜拯勉,卻給世界環(huán)境...
    茶點故事閱讀 41,013評論 3 325
  • 文/蒙蒙 一竟趾、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧宫峦,春花似錦岔帽、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,664評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至妥曲,卻和暖如春贾费,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背檐盟。 一陣腳步聲響...
    開封第一講書人閱讀 32,818評論 1 269
  • 我被黑心中介騙來泰國打工褂萧, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人葵萎。 一個月前我還...
    沈念sama閱讀 47,711評論 2 368
  • 正文 我出身青樓箱玷,卻偏偏與公主長得像,于是被迫代替她去往敵國和親陌宿。 傳聞我的和親對象是個殘疾皇子锡足,可洞房花燭夜當晚...
    茶點故事閱讀 44,601評論 2 353

推薦閱讀更多精彩內(nèi)容