' |7 c$ \; w+ d: }0 ^4 e应输出:; N N. o2 \4 Y0 ^2 Y0 P+ x6 m6 K' e
$ v* s" l/ Y" O( z+ ~; o* e# Z9 Q! Z' C. C4 `) |
. {) d" P$ b& U, x) j
Bundler version 1.17.3+ k* K- U" U0 B1 \% C% J
$ @7 E" W4 `/ Z& Q" t, ~# b
) l- _# P: q4 R/ N; A" D* f* f
$ E; ~/ X2 V: ?0 b, p. P 到这里环境已经安装成功!安装依赖并启动:4 {! R! }( r) @3 a, n- Y( C
! p, e1 i7 y- V- M) e! g( J$ n1 G 6 W9 M V5 M6 a5 @# K+ M$ c& n' W* t
cd /home/root/dldl-gm && sh restart-alpha.sh " ~1 Q+ J" V+ R! F ' G6 ? ?! B7 O4 m2 U# z/ C S, h5 t% z- z
4 d2 G3 {7 e9 i( X0 z 会报错如下: ! C- O( N& _, I. u/ F/ M; ~8 M% l3 o6 q. n$ W7 t
' S% P ], q1 K 8 A8 T) ~! a8 ]Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this ! o2 w9 p# D. Y% r( k5 j$ o9 H1 |( y- |( u( ]$ a- U8 \
application for all non-root users on this machine. 7 u7 o: b k9 b7 ?; Q" l( K' Y0 X6 r3 p0 ], z$ l
Fetching source index from http://rubygems.org/ 2 K# V" p+ p) h) \; X+ Y* g& f* F9 s7 C& k8 z" {( |( N
9 V0 Y* w) w5 T! H* ?- E$ N
) J4 r# v% a; `* ~2 n' d( ~Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/9 g y* o. [& ` j! Y- D. H8 Y
- _1 b2 X" T* t& D
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/2 E" R2 B% L3 z' M, W5 i. w( H
! N4 Y$ X: }5 T) l: p+ r解决方案一:全局配置 Bundler 使用 Ruby China 镜像(HTTPS)) c2 \! ^) Z% L# V
+ ]# l$ F" _! P& z# u+ P) M
: n' I( E0 A5 y, m% h3 m 7 l% }8 P9 N: l. C0 pbundle config set --global mirror.http://rubygems.org https://gems.ruby-china.com 7 P* c! F g# A9 D- m0 R4 q, r& B- R" d! G0 i6 T# F2 R/ X! k
bundle config set --global mirror.https://rubygems.org https://gems.ruby-china.com& ^/ t3 H4 L1 Q- ~
5 K5 V9 F$ e" o5 P* g [5 @ 0 d, T4 t, l- D9 G) h# O# @% B3 C' a1 x. O: X; @ 验证配置: . g! g/ }" k- ? 6 q5 J8 ]" i, z! g: }, V ' k# O2 i* s' b2 ` ( d; j8 J; {! V6 J6 ^ {bundle config list % s' k9 Y. t' _" @9 M " L9 \* Z. z9 v 0 f1 O1 n; F1 Z+ w7 P" M9 `$ C* O3 {- e$ L 应看到类似: % X" E& w# Y5 X+ g3 b8 Z/ p8 S$ n. L. s0 D. O$ \4 e( @
" H) A$ f, W& t" P- S1 m0 H- a/ L
Settings are listed in order of priority. The top value will be used." A4 n8 n; ~! Y, q4 q
7 E* Z. o. B: Q% [7 m& w
mirror.http://rubygems.org0 v @! a0 [( L. ^
. b6 n& t: Z8 P+ m% {* A GSet via BUNDLE_MIRROR__HTTP://RUBYGEMS__ORG: "https://gems.ruby-china.com" # [2 V8 A3 }3 j# t: _" Y) | % q$ }: G I: U4 e' v5 Fmirror.https://rubygems.org5 r. h: l' g' n9 x( I
6 }) w; @0 x8 `8 Z2 ?% M. vSet via BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG: "https://gems.ruby-china.com" ' U3 H, c9 m E7 P * e% u' S7 r' V. N7 a* S, b8 F/ P. R
: n) k( c! V8 S# M: s8 J 这会把所有对 rubygems.org 的请求(无论 HTTP/HTTPS)都重定向到 https://gems.ruby-china.com解决方案二: / Y2 P+ E: K8 Y/ I! @6 b& m; m# o* `% K2 P, h) @( m* ]
; c& h+ ^# S6 L. b" x
# G4 ]: R9 s, e1 w9 ?6 `) Q
打开:/home/root/dldl-gm/Gemfile和Gemfile.lock6 u# ~0 D ?3 G1 {1 w
7 p9 F8 @0 p* A6 r4 Q
+ h& P0 U2 s' `5 K3 H" {6 C* e