( x' ]. Z) ?% R. v9 P0 E7 P5 h, P, f7 }' }3 F$ G/ t; `+ M% Y4 k0 R
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this , v% D5 _& y" t3 f0 Z1 l Z$ W# o0 h" \/ t6 z% R8 O
application for all non-root users on this machine.7 G2 q0 p) m! F, i" d# N
# a0 c8 t" @0 f) `5 GFetching source index from http://rubygems.org/! R9 r1 r/ S2 d! P6 V
# j- w2 i, h& m' q & P4 K ]! e( F( p- r e- I % t4 ~1 n& T) l" I3 BRetrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/) @6 w$ B. {# h
1 O6 a8 \0 ^% h4 wRetrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/ / u, _6 Q8 f5 _! M" |9 y, g# f( H" Z1 |' P1 K/ a" G2 C- Y0 C
% j g7 E* D/ X1 ~% R. C# z3 n6 H5 f! E$ N 解决方案一:全局配置 Bundler 使用 Ruby China 镜像(HTTPS) . ?. O, q+ i# U( A2 Q5 g u3 ]' T8 B- V4 h7 x" [
" w& T: ]" R3 C
Y# n6 m* s- M1 Z
bundle config set --global mirror.http://rubygems.org https://gems.ruby-china.com / i0 t4 q# m4 ^1 V5 V# n ' g& C8 A! }& ~bundle config set --global mirror.https://rubygems.org https://gems.ruby-china.com + b9 D8 e0 n5 M- N6 N9 z4 Y+ V- G6 d8 W
( G: Z- U; I7 W9 X$ X* [8 Y % p) x0 k( D4 ~$ ^验证配置: 2 @- Q$ I; Q3 q& y/ |0 G s . z- Q7 f9 z2 j( [$ | 8 G8 Q+ S5 _3 R+ l' R$ a - d" ]/ q& }: a; ybundle config list 2 ?5 {: t: I* N; z1 Q0 h G + O0 D4 h; i7 t/ x* ?' H9 }+ |- v0 z8 }! X
9 W" V. t% E; M( H5 o1 X. L 6 n5 x: O; H. tSettings are listed in order of priority. The top value will be used. 7 ^! {) o$ h, ~/ j6 [ n% i ]; T6 _0 l$ a+ L
mirror.http://rubygems.org; l: y8 j9 M( |$ a
( Y& [9 X& ^5 q# H! {1 C9 `- z( O, D; hSet via BUNDLE_MIRROR__HTTP://RUBYGEMS__ORG: "https://gems.ruby-china.com" 4 R* z* Z! ~# k1 G. U ( o$ l' c( ~. X. amirror.https://rubygems.org 8 a( A1 d) c3 V) W ' B2 J U# e0 T" J; a( A% t* QSet via BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG: "https://gems.ruby-china.com"' I$ e' v' P- H6 O% B0 q