redmine 安装
现在redmine安装部署的方法有很多,有安装包,docker,虚拟机镜像,还可以在ubuntu,centos中添加安装源。
但是最好维护方法还是从源码去部署。
一. 目标环境:
1. Redmine 3.2.1
2. ruby 2.2
3. PostgreSQL 9.5.1
4. Linux_x86_64 (centos or ubuntu)
Redmine 运行在普通用户 wzy 下
二. 准备用户环境:
1.安装软件环境,此环境后面安装ruby会用到
centos运行下面的命令
yum install -y patch libyaml-devel glibc-headers autoconf gcc-c++ glibc-devel patch readline-devel zlib-devel libffi-devel openssl-devel bzip2 automake libtool bison sqlite-devel ImageMagick ImageMagick-devel
ubuntu运行下面的命令
sudo apt-get -y install g++ make libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgmp-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev imagemagick-common imagemagick
2. 用root登陆,创建用户wzy,修改/opt用户为wzy ,然后切换到wzy用户下
useradd wzy chown wzy /opt su - wzy
3. 下载工具
mkdir /opt/resource cd /opt/resource wget https://www.redmine.org/releases/redmine-3.2.1.tar.gz wget http://get.enterprisedb.com/postgresql/postgresql-9.5.1-1-linux-x64.run
4. 安装postgres数据库,密码设为postgres,其它直接按回车选默认值即可。
chmod u+x postgresql-9.5.1-1-linux-x64.run ./postgresql-9.5.1-1-linux-x64.run ---------------------------------------------------------------------------- Welcome to the PostgreSQL Setup Wizard. ---------------------------------------------------------------------------- Please specify the directory where PostgreSQL will be installed. Installation Directory [/opt/PostgreSQL/9.5]: ---------------------------------------------------------------------------- Please select a directory under which to store your data. Data Directory [/opt/PostgreSQL/9.5/data]: ---------------------------------------------------------------------------- Please provide a password for the database superuser (postgres). A locked Unix user account (postgres) will be created if not present. Password : Retype password : Warning: Passwords Do Not Match! Press [Enter] to continue: ---------------------------------------------------------------------------- Please provide a password for the database superuser (postgres). A locked Unix user account (postgres) will be created if not present. Password : Retype password : ---------------------------------------------------------------------------- Please select the port number the server should listen on. Port [5432]: ---------------------------------------------------------------------------- Advanced Options Select the locale to be used by the new database cluster. Locale [1] [Default locale] [2] aa_DJ [3] aa_DJ.iso88591 [4] aa_DJ.utf8 [5] aa_ER [6] aa_ER@saaho [7] aa_ER.utf8 [8] aa_ER.utf8@saaho [9] aa_ET [10] aa_ET.utf8 [11] af_ZA [12] af_ZA.iso88591 [13] af_ZA.utf8 [14] am_ET [15] am_ET.utf8 [16] an_ES [17] an_ES.iso885915 [18] an_ES.utf8 [19] ar_AE [20] ar_AE.iso88596 [21] ar_AE.utf8 [22] ar_BH [23] ar_BH.iso88596 [24] ar_BH.utf8 [25] ar_DZ [26] ar_DZ.iso88596 [27] ar_DZ.utf8 [28] ar_EG [29] ar_EG.iso88596 [30] ar_EG.utf8 [31] ar_IN [32] ar_IN.utf8 [33] ar_IQ [34] ar_IQ.iso88596 [35] ar_IQ.utf8 [36] ar_JO [37] ar_JO.iso88596 [38] ar_JO.utf8 [39] ar_KW [40] ar_KW.iso88596 [41] ar_KW.utf8 [42] ar_LB [43] ar_LB.iso88596 [44] ar_LB.utf8 [45] ar_LY [46] ar_LY.iso88596 [47] ar_LY.utf8 [48] ar_MA [49] ar_MA.iso88596 [50] ar_MA.utf8 [51] ar_OM [52] ar_OM.iso88596 [53] ar_OM.utf8 [54] ar_QA [55] ar_QA.iso88596 [56] ar_QA.utf8 [57] ar_SA [58] ar_SA.iso88596 [59] ar_SA.utf8 [60] ar_SD [61] ar_SD.iso88596 [62] ar_SD.utf8 [63] ar_SY [64] ar_SY.iso88596 [65] ar_SY.utf8 [66] ar_TN [67] ar_TN.iso88596 [68] ar_TN.utf8 [69] ar_YE [70] ar_YE.iso88596 [71] ar_YE.utf8 [72] as_IN [73] as_IN.utf8 [74] ast_ES [75] ast_ES.iso885915 [76] ast_ES.utf8 [77] ayc_PE [78] ayc_PE.utf8 [79] az_AZ [80] az_AZ.utf8 [81] be_BY [82] be_BY.cp1251 [83] be_BY@latin [84] be_BY.utf8 [85] be_BY.utf8@latin [86] bem_ZM [87] bem_ZM.utf8 [88] ber_DZ [89] ber_DZ.utf8 [90] ber_MA [91] ber_MA.utf8 [92] bg_BG [93] bg_BG.cp1251 [94] bg_BG.utf8 [95] bho_IN [96] bho_IN.utf8 [97] bn_BD [98] bn_BD.utf8 [99] bn_IN [100] bn_IN.utf8 [101] bo_CN [102] bo_CN.utf8 [103] bo_IN [104] bo_IN.utf8 [105] bokmal [106] bokmål [107] br_FR [108] br_FR@euro [109] br_FR.iso88591 [110] br_FR.iso885915@euro [111] br_FR.utf8 [112] brx_IN [113] brx_IN.utf8 [114] bs_BA [115] bs_BA.iso88592 [116] bs_BA.utf8 [117] byn_ER [118] byn_ER.utf8 [119] C [120] ca_AD [121] ca_AD.iso885915 [122] ca_AD.utf8 [123] ca_ES [124] ca_ES@euro [125] ca_ES.iso88591 [126] ca_ES.iso885915@euro [127] ca_ES.utf8 [128] ca_FR [129] ca_FR.iso885915 [130] ca_FR.utf8 [131] ca_IT [132] ca_IT.iso885915 [133] ca_IT.utf8 [134] catalan [135] crh_UA [136] crh_UA.utf8 [137] croatian [138] csb_PL [139] csb_PL.utf8 [140] cs_CZ [141] cs_CZ.iso88592 [142] cs_CZ.utf8 [143] cv_RU [144] cv_RU.utf8 [145] cy_GB [146] cy_GB.iso885914 [147] cy_GB.utf8 [148] czech [149] da_DK [150] da_DK.iso88591 [151] da_DK.iso885915 [152] da_DK.utf8 [153] danish [154] dansk [155] de_AT [156] de_AT@euro [157] de_AT.iso88591 [158] de_AT.iso885915@euro [159] de_AT.utf8 [160] de_BE [161] de_BE@euro [162] de_BE.iso88591 [163] de_BE.iso885915@euro [164] de_BE.utf8 [165] de_CH [166] de_CH.iso88591 [167] de_CH.utf8 [168] de_DE [169] de_DE@euro [170] de_DE.iso88591 [171] de_DE.iso885915@euro [172] de_DE.utf8 [173] de_LU [174] de_LU@euro [175] de_LU.iso88591 [176] de_LU.iso885915@euro [177] de_LU.utf8 [178] deutsch [179] doi_IN [180] doi_IN.utf8 [181] dutch [182] dv_MV [183] dv_MV.utf8 [184] dz_BT [185] dz_BT.utf8 [186] eesti [187] el_CY [188] el_CY.iso88597 [189] el_CY.utf8 [190] el_GR [191] el_GR.iso88597 [192] el_GR.utf8 [193] en_AG [194] en_AG.utf8 [195] en_AU [196] en_AU.iso88591 [197] en_AU.utf8 [198] en_BW [199] en_BW.iso88591 [200] en_BW.utf8 [201] en_CA [202] en_CA.iso88591 [203] en_CA.utf8 [204] en_DK [205] en_DK.iso88591 [206] en_DK.utf8 [207] en_GB [208] en_GB.iso88591 [209] en_GB.iso885915 [210] en_GB.utf8 [211] en_HK [212] en_HK.iso88591 [213] en_HK.utf8 [214] en_IE [215] en_IE@euro [216] en_IE.iso88591 [217] en_IE.iso885915@euro [218] en_IE.utf8 [219] en_IN [220] en_IN.utf8 [221] en_NG [222] en_NG.utf8 [223] en_NZ [224] en_NZ.iso88591 [225] en_NZ.utf8 [226] en_PH [227] en_PH.iso88591 [228] en_PH.utf8 [229] en_SG [230] en_SG.iso88591 [231] en_SG.utf8 [232] en_US [233] en_US.iso88591 [234] en_US.iso885915 [235] en_US.utf8 [236] en_ZA [237] en_ZA.iso88591 [238] en_ZA.utf8 [239] en_ZM [240] en_ZM.utf8 [241] en_ZW [242] en_ZW.iso88591 [243] en_ZW.utf8 [244] es_AR [245] es_AR.iso88591 [246] es_AR.utf8 [247] es_BO [248] es_BO.iso88591 [249] es_BO.utf8 [250] es_CL [251] es_CL.iso88591 [252] es_CL.utf8 [253] es_CO [254] es_CO.iso88591 [255] es_CO.utf8 [256] es_CR [257] es_CR.iso88591 [258] es_CR.utf8 [259] es_CU [260] es_CU.utf8 [261] es_DO [262] es_DO.iso88591 [263] es_DO.utf8 [264] es_EC [265] es_EC.iso88591 [266] es_EC.utf8 [267] es_ES [268] es_ES@euro [269] es_ES.iso88591 [270] es_ES.iso885915@euro [271] es_ES.utf8 [272] es_GT [273] es_GT.iso88591 [274] es_GT.utf8 [275] es_HN [276] es_HN.iso88591 [277] es_HN.utf8 [278] es_MX [279] es_MX.iso88591 [280] es_MX.utf8 [281] es_NI [282] es_NI.iso88591 [283] es_NI.utf8 [284] es_PA [285] es_PA.iso88591 [286] es_PA.utf8 [287] es_PE [288] es_PE.iso88591 [289] es_PE.utf8 [290] es_PR [291] es_PR.iso88591 [292] es_PR.utf8 [293] es_PY [294] es_PY.iso88591 [295] es_PY.utf8 [296] es_SV [297] es_SV.iso88591 [298] es_SV.utf8 [299] estonian [300] es_US [301] es_US.iso88591 [302] es_US.utf8 [303] es_UY [304] es_UY.iso88591 [305] es_UY.utf8 [306] es_VE [307] es_VE.iso88591 [308] es_VE.utf8 [309] et_EE [310] et_EE.iso88591 [311] et_EE.iso885915 [312] et_EE.utf8 [313] eu_ES [314] eu_ES@euro [315] eu_ES.iso88591 [316] eu_ES.iso885915@euro [317] eu_ES.utf8 [318] fa_IR [319] fa_IR.utf8 [320] ff_SN [321] ff_SN.utf8 [322] fi_FI [323] fi_FI@euro [324] fi_FI.iso88591 [325] fi_FI.iso885915@euro [326] fi_FI.utf8 [327] fil_PH [328] fil_PH.utf8 [329] finnish [330] fo_FO [331] fo_FO.iso88591 [332] fo_FO.utf8 [333] français [334] fr_BE [335] fr_BE@euro [336] fr_BE.iso88591 [337] fr_BE.iso885915@euro [338] fr_BE.utf8 [339] fr_CA [340] fr_CA.iso88591 [341] fr_CA.utf8 [342] fr_CH [343] fr_CH.iso88591 [344] fr_CH.utf8 [345] french [346] fr_FR [347] fr_FR@euro [348] fr_FR.iso88591 [349] fr_FR.iso885915@euro [350] fr_FR.utf8 [351] fr_LU [352] fr_LU@euro [353] fr_LU.iso88591 [354] fr_LU.iso885915@euro [355] fr_LU.utf8 [356] fur_IT [357] fur_IT.utf8 [358] fy_DE [359] fy_DE.utf8 [360] fy_NL [361] fy_NL.utf8 [362] ga_IE [363] ga_IE@euro [364] ga_IE.iso88591 [365] ga_IE.iso885915@euro [366] ga_IE.utf8 [367] galego [368] galician [369] gd_GB [370] gd_GB.iso885915 [371] gd_GB.utf8 [372] german [373] gez_ER [374] gez_ER@abegede [375] gez_ER.utf8 [376] gez_ER.utf8@abegede [377] gez_ET [378] gez_ET@abegede [379] gez_ET.utf8 [380] gez_ET.utf8@abegede [381] gl_ES [382] gl_ES@euro [383] gl_ES.iso88591 [384] gl_ES.iso885915@euro [385] gl_ES.utf8 [386] greek [387] gu_IN [388] gu_IN.utf8 [389] gv_GB [390] gv_GB.iso88591 [391] gv_GB.utf8 [392] ha_NG [393] ha_NG.utf8 [394] hebrew [395] he_IL [396] he_IL.iso88598 [397] he_IL.utf8 [398] hi_IN [399] hi_IN.utf8 [400] hne_IN [401] hne_IN.utf8 [402] hr_HR [403] hr_HR.iso88592 [404] hr_HR.utf8 [405] hrvatski [406] hsb_DE [407] hsb_DE.iso88592 [408] hsb_DE.utf8 [409] ht_HT [410] ht_HT.utf8 [411] hu_HU [412] hu_HU.iso88592 [413] hu_HU.utf8 [414] hungarian [415] hy_AM [416] hy_AM.utf8 [417] ia_FR [418] ia_FR.utf8 [419] icelandic [420] id_ID [421] id_ID.iso88591 [422] id_ID.utf8 [423] ig_NG [424] ig_NG.utf8 [425] ik_CA [426] ik_CA.utf8 [427] is_IS [428] is_IS.iso88591 [429] is_IS.utf8 [430] italian [431] it_CH [432] it_CH.iso88591 [433] it_CH.utf8 [434] it_IT [435] it_IT@euro [436] it_IT.iso88591 [437] it_IT.iso885915@euro [438] it_IT.utf8 [439] iu_CA [440] iu_CA.utf8 [441] iw_IL [442] iw_IL.iso88598 [443] iw_IL.utf8 [444] ja_JP [445] ja_JP.eucjp [446] ja_JP.ujis [447] ja_JP.utf8 [448] japanese [449] japanese.euc [450] ka_GE.utf8 [451] kk_KZ.utf8 [452] kl_GL [453] kl_GL.iso88591 [454] kl_GL.utf8 [455] km_KH [456] km_KH.utf8 [457] kn_IN [458] kn_IN.utf8 [459] kok_IN [460] kok_IN.utf8 [461] ko_KR [462] ko_KR.euckr [463] ko_KR.utf8 [464] korean [465] korean.euc [466] ks_IN [467] ks_IN@devanagari [468] ks_IN.utf8 [469] ks_IN.utf8@devanagari [470] ku_TR [471] ku_TR.iso88599 [472] ku_TR.utf8 [473] kw_GB [474] kw_GB.iso88591 [475] kw_GB.utf8 [476] ky_KG [477] ky_KG.utf8 [478] lb_LU [479] lb_LU.utf8 [480] lg_UG [481] lg_UG.iso885910 [482] lg_UG.utf8 [483] li_BE [484] li_BE.utf8 [485] lij_IT [486] lij_IT.utf8 [487] li_NL [488] li_NL.utf8 [489] lithuanian [490] lo_LA [491] lo_LA.utf8 [492] lt_LT [493] lt_LT.iso885913 [494] lt_LT.utf8 [495] lv_LV [496] lv_LV.iso885913 [497] lv_LV.utf8 [498] mag_IN [499] mag_IN.utf8 [500] mai_IN [501] mai_IN.utf8 [502] mg_MG [503] mg_MG.iso885915 [504] mg_MG.utf8 [505] mhr_RU [506] mhr_RU.utf8 [507] mi_NZ [508] mi_NZ.iso885913 [509] mi_NZ.utf8 [510] mk_MK [511] mk_MK.iso88595 [512] mk_MK.utf8 [513] ml_IN [514] ml_IN.utf8 [515] mni_IN [516] mni_IN.utf8 [517] mn_MN [518] mn_MN.utf8 [519] mr_IN [520] mr_IN.utf8 [521] ms_MY [522] ms_MY.iso88591 [523] ms_MY.utf8 [524] mt_MT [525] mt_MT.iso88593 [526] mt_MT.utf8 [527] my_MM [528] my_MM.utf8 [529] nan_TW@latin [530] nan_TW.utf8@latin [531] nb_NO [532] nb_NO.iso88591 [533] nb_NO.utf8 [534] nds_DE [535] nds_DE.utf8 [536] nds_NL [537] nds_NL.utf8 [538] ne_NP [539] ne_NP.utf8 [540] nhn_MX [541] nhn_MX.utf8 [542] niu_NU [543] niu_NU.utf8 [544] niu_NZ [545] niu_NZ.utf8 [546] nl_AW [547] nl_AW.utf8 [548] nl_BE [549] nl_BE@euro [550] nl_BE.iso88591 [551] nl_BE.iso885915@euro [552] nl_BE.utf8 [553] nl_NL [554] nl_NL@euro [555] nl_NL.iso88591 [556] nl_NL.iso885915@euro [557] nl_NL.utf8 [558] nn_NO [559] nn_NO.iso88591 [560] nn_NO.utf8 [561] no_NO [562] norwegian [563] nr_ZA [564] nr_ZA.utf8 [565] nso_ZA [566] nso_ZA.utf8 [567] nynorsk [568] oc_FR [569] oc_FR.iso88591 [570] oc_FR.utf8 [571] om_ET [572] om_ET.utf8 [573] om_KE [574] om_KE.iso88591 [575] om_KE.utf8 [576] or_IN [577] or_IN.utf8 [578] os_RU [579] os_RU.utf8 [580] pa_IN [581] pa_IN.utf8 [582] pap_AN [583] pap_AN.utf8 [584] pa_PK [585] pa_PK.utf8 [586] pl_PL [587] pl_PL.iso88592 [588] pl_PL.utf8 [589] polish [590] portuguese [591] POSIX [592] ps_AF [593] ps_AF.utf8 [594] pt_BR [595] pt_BR.iso88591 [596] pt_BR.utf8 [597] pt_PT [598] pt_PT@euro [599] pt_PT.iso88591 [600] pt_PT.iso885915@euro [601] pt_PT.utf8 [602] romanian [603] ro_RO [604] ro_RO.iso88592 [605] ro_RO.utf8 [606] ru_RU [607] ru_RU.iso88595 [608] ru_RU.koi8r [609] ru_RU.utf8 [610] russian [611] ru_UA [612] ru_UA.koi8u [613] ru_UA.utf8 [614] rw_RW [615] rw_RW.utf8 [616] sa_IN [617] sa_IN.utf8 [618] sat_IN [619] sat_IN.utf8 [620] sc_IT [621] sc_IT.utf8 [622] sd_IN [623] sd_IN@devanagari [624] sd_IN.utf8 [625] sd_IN.utf8@devanagari [626] se_NO [627] se_NO.utf8 [628] shs_CA [629] shs_CA.utf8 [630] sid_ET [631] sid_ET.utf8 [632] si_LK [633] si_LK.utf8 [634] sk_SK [635] sk_SK.iso88592 [636] sk_SK.utf8 [637] slovak [638] slovene [639] slovenian [640] sl_SI [641] sl_SI.iso88592 [642] sl_SI.utf8 [643] so_DJ [644] so_DJ.iso88591 [645] so_DJ.utf8 [646] so_ET [647] so_ET.utf8 [648] so_KE [649] so_KE.iso88591 [650] so_KE.utf8 [651] so_SO [652] so_SO.iso88591 [653] so_SO.utf8 [654] spanish [655] sq_AL [656] sq_AL.iso88591 [657] sq_AL.utf8 [658] sq_MK [659] sq_MK.utf8 [660] sr_ME [661] sr_ME.utf8 [662] sr_RS [663] sr_RS@latin [664] sr_RS.utf8 [665] sr_RS.utf8@latin [666] ss_ZA [667] ss_ZA.utf8 [668] st_ZA [669] st_ZA.iso88591 [670] st_ZA.utf8 [671] sv_FI [672] sv_FI@euro [673] sv_FI.iso88591 [674] sv_FI.iso885915@euro [675] sv_FI.utf8 [676] sv_SE [677] sv_SE.iso88591 [678] sv_SE.iso885915 [679] sv_SE.utf8 [680] swedish [681] sw_KE [682] sw_KE.utf8 [683] sw_TZ [684] sw_TZ.utf8 [685] szl_PL [686] szl_PL.utf8 [687] ta_IN [688] ta_IN.utf8 [689] ta_LK [690] ta_LK.utf8 [691] te_IN [692] te_IN.utf8 [693] tg_TJ.utf8 [694] th_TH.utf8 [695] ti_ER [696] ti_ER.utf8 [697] ti_ET [698] ti_ET.utf8 [699] tig_ER [700] tig_ER.utf8 [701] tk_TM [702] tk_TM.utf8 [703] tl_PH [704] tl_PH.iso88591 [705] tl_PH.utf8 [706] tn_ZA [707] tn_ZA.utf8 [708] tr_CY [709] tr_CY.iso88599 [710] tr_CY.utf8 [711] tr_TR [712] tr_TR.iso88599 [713] tr_TR.utf8 [714] ts_ZA [715] ts_ZA.utf8 [716] tt_RU [717] tt_RU@iqtelif [718] tt_RU.utf8 [719] tt_RU.utf8@iqtelif [720] turkish [721] ug_CN [722] ug_CN.utf8 [723] uk_UA [724] uk_UA.koi8u [725] uk_UA.utf8 [726] unm_US [727] unm_US.utf8 [728] ur_IN [729] ur_IN.utf8 [730] ur_PK [731] ur_PK.utf8 [732] uz_UZ [733] uz_UZ@cyrillic [734] uz_UZ.iso88591 [735] uz_UZ.utf8@cyrillic [736] ve_ZA [737] ve_ZA.utf8 [738] vi_VN [739] vi_VN.utf8 [740] wa_BE [741] wa_BE@euro [742] wa_BE.iso88591 [743] wa_BE.iso885915@euro [744] wa_BE.utf8 [745] wae_CH [746] wae_CH.utf8 [747] wal_ET [748] wal_ET.utf8 [749] wo_SN [750] wo_SN.utf8 [751] xh_ZA [752] xh_ZA.iso88591 [753] xh_ZA.utf8 [754] yi_US [755] yi_US.cp1255 [756] yi_US.utf8 [757] yo_NG [758] yo_NG.utf8 [759] yue_HK [760] yue_HK.utf8 [761] zh_CN [762] zh_CN.gb2312 [763] zh_CN.utf8 [764] zh_HK.utf8 [765] zh_SG [766] zh_SG.gb2312 [767] zh_SG.utf8 [768] zh_TW.euctw [769] zh_TW.utf8 [770] zu_ZA [771] zu_ZA.iso88591 [772] zu_ZA.utf8 Please choose an option [1] : ---------------------------------------------------------------------------- Setup is now ready to begin installing PostgreSQL on your computer. Do you want to continue? [Y/n]: ---------------------------------------------------------------------------- Please wait while Setup installs PostgreSQL on your computer. Installing 0% ______________ 50% ______________ 100% ######################################### ---------------------------------------------------------------------------- Setup has finished installing PostgreSQL on your computer.
5. 创建数据库redmine,所属用户:redmine ,密码: redmine
source /opt/PostgreSQL/9.5/pg_env.sh psql -U postgres
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity'; CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
\q
三. 准备ruby环境:
1. 安装rvm,并修改为淘宝源
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \curl -sSL https://get.rvm.io | bash -s stable source /home/wzy/.rvm/scripts/rvm sed -i -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
2.安装ruby,并修改为淘宝源
rvm install 2.2 gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/ gem install bundler bundle config mirror.https://rubygems.org https://ruby.taobao.org
四. 安装redmine:
1.解压redmine安装包到/opt目录
tar xzvf redmine-3.2.1.tar.gz -C /opt
cd /opt/redmine-3.2.1
2. 配置数据库
cd /opt/redmine-3.2.1/config
touch database.yml
vi database.yml
将下面内容添加到database.yml
production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
schema_search_path: public
3. 安装redmine需要的组件
bundle install --without development test
(##############################################################
在这个地方可能会遇到一个错误:
Bundler could not find compatible versions for gem "rbpdf-font": In Gemfile: rbpdf (~> 1.19.0) was resolved to 1.19.0, which depends on rbpdf-font (~> 1.19.0) Could not find gem 'rbpdf-font (~> 1.19.0)', which is required by gem 'rbpdf (~>1.19.0)', in any of the sources.
可以用下面的命令解决
gem install rbpdf-font
################################################################)
4. 生成秘钥
bundle exec rake generate_secret_token
(##############################################################
在这个地方可能会遇到一个错误:
/home/wzy/.rvm/gems/ruby-2.2.4/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
打开expanded.rb,可以看到465和466一样,将其中一行注释掉就可以了
'inodot' => 0x0131, # ı dup LATIN SMALL LETTER DOTLESS I #'inodot' => 0x0131, # ı dup LATIN SMALL LETTER DOTLESS I
##############################################################)
5. 初始化数据库
RAILS_ENV=production bundle exec rake db:migrate
6. 导入默认数据,选择中文
RAILS_ENV=production REDMINE_LANG=zh bundle exec rake redmine:load_default_data
五. 测试redmine是否能成功启动:
bundle exec rails server webrick -e production -b 0.0.0.0 -d
用浏览器访问,默认管理员:admin ,密码:admin
如果能正常访问就大功告成了,剩下的就是添加邮箱等配置管理的工作了。
但是这种环境只适合内部测试使用,如果部署在生产环境,还是需要 mod_fcgid 支持,
后面会另写一篇关于如何在apache中部署redmine的文章。