( H. |9 }, P% N9 a1 t6 L0 p1 X4 r: z 9 q% Y h9 a5 n2 N4 `( u + L, _; Y, _' s: ?1 @+ t- S6 JERROR: Could not find a valid gem 'bundler' (= 1.17.3), here is why:! o+ y6 Q9 J( G* }& B
4 k b0 I/ s( G; Z! H" S6 Z* N
Unable to download data from https://rubygems.org/ - Errno::ENETUNREACH: Network is unreachable - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8.gz)' D2 n% q8 c, Z0 Y: l
8 k c) I; o! |; R! q7 A( L
, ^2 \9 x3 F, T9 ~) n! c ! n( v: C3 Y3 Y0 O/ T, s6 P7 E0 N, j5 m' rcd /home/root/dldl-gm && sh restart-alpha.sh# B1 |9 D+ t1 T6 @) n
g6 d. T; }& E( c8 l9 i8 J& w3 _8 T0 E( u
. y, J- j1 y- p" u: Z, C 会报错如下:. H' V" S9 b A9 f# z ^
2 x. O2 U9 X' f; u- e( }" @
% J7 m* g0 ^" d% s; Y9 Y } 3 `6 j: P$ E5 c; u1 IDon't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this- T, @3 F4 y; F% r2 e9 ?
; R/ q* E8 a5 ~application for all non-root users on this machine.- U, E' `' r! j9 }: |" J2 t
: x$ E0 v2 H9 E+ q4 Q0 i
Fetching source index from http://rubygems.org/& E' H, E) [$ D6 N
8 T. G( x$ A. v; A ) _0 `3 O7 j6 |0 ]8 _5 g5 \7 ?- }4 ^1 V
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/3 {) q6 z1 o! I p7 J( S; t M
' b7 N/ N. K9 d4 a: |2 E- e
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/ ' a1 R, ~: ` j6 R, K ! x+ L, j! ~9 C9 `: Y6 ? ' n! h: c% g1 ^: `1 d' [ b1 f: P3 C. ~; \. N$ v! T" D 解决方案一:全局配置 Bundler 使用 Ruby China 镜像(HTTPS)& ` Z2 ?1 y; T8 n
7 S' o+ J" q% C 7 E1 ~7 g* M9 `, r( O3 B `; W
bundle config set --global mirror.http://rubygems.org https://gems.ruby-china.com6 E* s4 s: v0 h! O. Q
4 L. |- @0 @, t8 \* b, D3 W/ ebundle config set --global mirror.https://rubygems.org https://gems.ruby-china.com + Y. e% g! J# Q2 c; D: }$ J* K# j, z) u
- A' g {" U( w" l4 |
! L; [' e! c3 m7 f 验证配置: : [# A" Y h' Q4 @0 H8 G( c: u+ b; h, [& i0 K2 ^4 E" H- K
9 M7 d+ L: s6 y" k9 Q4 b+ H
8 o" u$ ^, q" i8 obundle config list* k6 y% \+ k0 f' ^
$ X( z0 V2 T& z5 t. `1 f5 E" P
! K+ d$ d5 X1 U5 i
" }' _6 `- h, D7 k' u# B5 _: r. l应看到类似:% Q: T: k! r. g9 o: O$ c0 u
6 e; q9 W! H- ^3 _7 [1 T ; Z: b. o* F2 v9 i9 J& O5 \ 6 K2 \) ]/ b: `$ b: sSettings are listed in order of priority. The top value will be used. " U) P& S( {( { & y$ n$ {: @, b, w; c7 k0 [3 V+ B2 pmirror.http://rubygems.org( E( Z- f) a% W( c/ J& X/ p
1 h; }1 v _, z9 y$ L2 R8 H
Set via BUNDLE_MIRROR__HTTP://RUBYGEMS__ORG: "https://gems.ruby-china.com"; J; e/ H4 q2 n4 K4 ^0 }: l, M" o
. d8 E. I* c$ A- J
mirror.https://rubygems.org 8 D! O; h* L# O$ N0 a; W+ ?5 X0 u, ~5 O. d. H. _
Set via BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG: "https://gems.ruby-china.com" / e1 B" Z+ ~3 t , b5 _. d, E- O' O7 c: V2 E' ^+ j& J2 S; g
- ?- Q+ o5 m1 k$ n: y( i 这会把所有对 rubygems.org 的请求(无论 HTTP/HTTPS)都重定向到 https://gems.ruby-china.com解决方案二: + H# `! y2 r2 z C$ L1 I* a- P4 V* R: i [- i/ s
- G) T0 `. `3 G* h/ s1 W+ |+ j, K8 k7 C. g- P
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this2 q) m/ Y3 m: I) t" C
9 J4 S7 S' a. ~. K, O3 yapplication for all non-root users on this machine., d. J q! v: J6 l) ?5 N/ Q1 M
. h* N/ e' c. O; h8 | ~! RFetching gem metadata from https://gems.ruby-china.com/..........0 `2 [9 }6 P: [( x" o
0 ^/ u) p: _( qFetching rake 12.3.1 _! | L! y5 I) O/ x y* G# L/ e* ZInstalling rake 12.3.1 . |. A" c) u: n/ }% F. p7 ? - ?' P2 I0 Y: M h, E6 z4 D& Y9 E5 E/ ^Fetching concurrent-ruby 1.0.5 - c$ t7 z* N5 L/ G 9 f. j* A, j# Z6 `0 f9 F7 Y) Y9 R+ v6 a2 e+ M) P/ x8 M* J1 F. `
+ J1 ]8 H2 c9 B3 P1 V: O. G 恭喜您,这就是已经在正常安装依赖了! / d+ ?4 X% S7 I4 K4 h( J: n( F4 |