9 X/ `, d* x8 y- `8 G1 n d `$ i$ F+ h/ l( R0 f
gem install ./bundler-1.17.3.gem# H5 M1 h- R% T, C
: H' K8 ~( _3 y' U5 [$ S( o
B- o- ?! w5 T4 d+ F, O* M/ R2 }0 c: K 安装完成后运行: , Z7 p/ X7 p; Z7 t 7 z' W' N% p8 v% W" v- f5 Q 1 {5 \3 e$ X' V# M0 u: U, u7 r; s ! Y2 ?: o5 q8 U s1 K5 Gbundle -v 0 Q4 Z% ` i. p. ]5 z; f0 q) l* ? & G a" h8 m4 L$ t; Y3 X+ s- E3 G7 H- d2 Q {; t0 L4 X) z
- f$ ? a( h& V. @. @. P2 t% d应输出:4 B( y, x: Y" o3 \. w3 t7 H5 o
# |9 G) [# H9 `5 w0 b( X& P: U" k0 H/ @; X3 S
% F9 E- K" c: I0 WBundler version 1.17.3) a6 l5 ]7 c, a' `- c1 T P
1 I% U( O g' ]* G3 ?1 U8 ]
5 L( [3 I9 v; j% H
4 N7 s. F1 ~* C) _7 N" ~7 N0 G 到这里环境已经安装成功!安装依赖并启动: 0 ]5 }# ?, H" ~" Q1 @ ; n& L8 p5 T! [# o3 j4 l" a3 _& D: m% J! @
$ t1 }9 H. j8 j ncd /home/root/dldl-gm && sh restart-alpha.sh 4 A' W/ b% L- D) l1 Z# [ 6 Z8 I5 c7 t1 I2 P+ b' Y5 o # _; c7 Q% a- | : V' d) f! t* L! w, g会报错如下:6 j5 `: L6 P5 [* Y
" G/ b! J6 A& ~* [: L) D1 a
6 E; A1 t* ?+ ^/ Y0 d& d3 u# s; N
. d+ M7 ^% ]6 m% x
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this % b" r" k: b! w z) t7 Z* h& k % o9 ]* o0 i% b9 o( Q8 Q2 L% Qapplication for all non-root users on this machine.3 Q! n( c- D1 M' y; G4 x7 w. ?" G
% x8 c; S- ]5 n4 n
Fetching source index from http://rubygems.org/ ' J8 `! H( G% f* C/ }6 p+ B: M * J5 x0 O9 N/ _, Y" D! D. r/ z- g: `4 `1 Z9 e! d+ }) w: M" @! z: j
4 b( s, R6 f: p8 t- P
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/ u& [ g' _" c& j' T" i4 P: y& J6 t3 S! j: U U. F: B
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/& H v# R6 A7 n! i
6 ?+ ^' U E7 u, V( \! Q8 D
1 t1 F: G" w# u- B
! ]- R) ^/ y0 K5 }- H 解决方案一:全局配置 Bundler 使用 Ruby China 镜像(HTTPS) ) j O. I$ H" }. h) o" Q4 x* h u. X5 W# L) z
) `) X5 b' b1 E
" B3 L R& ^' M
bundle config set --global mirror.http://rubygems.org https://gems.ruby-china.com$ q5 a' Z5 B0 X% H# f. V
+ @* |4 a. U$ f9 f3 B' a
bundle config set --global mirror.https://rubygems.org https://gems.ruby-china.com, e' f. ^) f5 x
5 c& L; z) C# o! z, `& d" G0 F# s" a. n0 m
* I/ d. |: b0 F4 ~2 R! N验证配置:( ]- t0 `8 Q7 B7 T: i
! R( O T! k# p; }% v$ N
- n/ q5 A- t* k; C1 j9 a
; [( u& F5 P4 d
bundle config list3 c- m7 o# v2 w
$ c j: M/ j# |( D! O0 v
2 z5 |; @' T6 W' @Settings are listed in order of priority. The top value will be used.0 ~- l. @6 H5 S8 @8 b& e* `
; E) t% c/ U9 J$ t& q5 t
mirror.http://rubygems.org6 q3 i9 P2 o- ~' G( N/ v9 d
! {6 z& K1 ~7 ]Set via BUNDLE_MIRROR__HTTP://RUBYGEMS__ORG: "https://gems.ruby-china.com" ' N! Y* b, p- d( W 7 h* j1 d$ \5 j5 I, }! p( ?mirror.https://rubygems.org ! `- W& @- P* R0 H* w& @" ]4 @/ M2 ?+ G& A( \ H7 ~- d' O
Set via BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG: "https://gems.ruby-china.com"7 V! w/ k& o5 Q8 ?$ A' j0 i
3 _5 j# P. C0 u; F# l ! P- K' R- {$ |. u& l$ ^* ~' G6 N, y& d) b 这会把所有对 rubygems.org 的请求(无论 HTTP/HTTPS)都重定向到 https://gems.ruby-china.com解决方案二:4 A* R7 S, i1 g+ Y V' V
) v/ h: F8 a \" W; p8 a) F, U1 Y
5 _7 P3 z2 r# k( [2 W: j/ r3 I1 ^
打开:/home/root/dldl-gm/Gemfile和Gemfile.lock 2 t4 f" P$ v2 x7 e' Y$ I* k. e( w( Y, ~5 K) K6 e' J O; a. I9 G
. K3 |0 S/ Y! G. m1 Q. r' f 2 ?7 o+ x4 u4 j, V3 G+ d [ * k! c8 }% R6 ^1 _7 M P2 x & t9 o H) Y& l. N# i8 h) P2 q. \8 |4 x1 s, g! p& w. p4 a; \
* q7 P- i0 g) W1 q' I重新安装依赖并启动: q G. }8 `! a# w. ]( {/ W" E, b4 K6 ~3 R
2 \/ s1 Z! n, u! p
4 q3 c0 t: {; N7 v8 y+ \/ e1 y7 M; c
cd /home/root/dldl-gm && sh restart-alpha.sh 8 A9 `+ c g+ q1 x* G( `# ?( B 6 w0 J, |% N& R9 p; j) I c& c2 |1 F5 o% q( P
+ |+ Z1 y, l& U/ | m( S% m! v* |5 j- q 应看到类似:4 S0 w+ A2 C5 {2 d) {7 g o
; k* v5 l, l# c; D$ S
9 X$ k4 W: h- a 5 s2 a- O& w( }9 MDon't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this % u( C1 f, L) a/ r" k% Q# O / v7 M! \" r. \. Rapplication for all non-root users on this machine.6 e1 t+ N# R8 B4 P) M* n
- M/ b& l/ y# L3 H- Y4 r1 @# F! kFetching gem metadata from https://gems.ruby-china.com/.......... " H" n9 _: U7 K g) g6 [$ h* B" E3 R2 I0 } U
Fetching rake 12.3.1 ! d+ Y' r5 ^0 ]6 d d3 ^* E : S3 @) Q; |4 [; }8 ZInstalling rake 12.3.1 $ O0 n# v# W/ j* y1 Z : }4 z* v; ~$ ^/ JFetching concurrent-ruby 1.0.5 % V t3 m/ z8 f) Y. F, m ( h$ r# a) v' }" b$ u0 @ # w, Z( @# d& K6 z# m % e" M' L4 ]+ f' ~6 c3 |9 | H恭喜您,这就是已经在正常安装依赖了!; } w4 w: Y: L1 }9 V; _