* V$ A1 ~4 x( \) i% v6 N0 n* L7 V4 I' Y7 w( X 本地安装:$ A, M+ {- x! b0 @& v
3 P( A/ u3 d" w# z' u% R ; D5 w! h5 P4 P+ Y# V% f' |% Z! \/ H) U. p7 v3 p
gem install ./bundler-1.17.3.gem 7 ~8 O, s" w1 X E: `+ ^ 5 e6 P9 s8 b! h1 O1 y' K . z+ m* K5 D! l+ ?9 b1 D $ Q/ m0 J, ~3 w# T; n1 U安装完成后运行: ' k& }- ~8 M/ ~9 ?6 f - n6 Y& w+ Z% D4 s9 L5 _, A9 Y6 h 7 u" I, q1 M0 H3 @( g r 1 _4 y+ h+ P* Y }( C* Zbundle -v $ H Y& q- v" t& K2 K( C6 |# `& |% v: z0 V3 a
. E: g0 v1 Z4 f @2 F6 i7 @& |1 |
* `& f: d+ M. x* T 应输出: 3 ~ y- E9 g2 B V3 m' A8 v0 W. L- K+ B7 ?# _* H. g: L
7 I, h# Q. b7 r7 { ; m2 {: ^$ i$ E1 r+ o* K* b! fBundler version 1.17.3 2 O' Z4 \1 `* i, \/ o0 C. c& W - C+ j1 C- x$ S9 a; g5 @4 o2 U2 `1 `4 R9 S3 {! h0 I- C1 U
* k' k' M9 n) N% l' E 到这里环境已经安装成功!安装依赖并启动: ( ]* n8 q( l2 Q5 z1 D3 }# _' T+ m/ P+ Q v& G
3 \* P0 e5 i; ]3 ~
$ _9 V1 A, s1 U" B
cd /home/root/dldl-gm && sh restart-alpha.sh * D# Y! k/ Z Y' e' w, P* ` {. I. n1 X. g/ ]; w; ]. b! B* z4 k, N w; `4 @9 l
' I6 {% K a2 x7 Y& ^会报错如下:- i% w5 {* \+ w3 z% @% B
% {; S6 U! L, x
# V; c3 K8 l( I# p/ S X% v8 d% J" Q* u3 a1 r _
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this6 o( v" D+ d4 G" E% p: U1 x
5 D/ O. Z+ m o
application for all non-root users on this machine.( P6 u. Y- X$ q* F7 w; Q/ E
; x% Q x" X, A- e4 Z
Fetching source index from http://rubygems.org/ 8 }" O& G1 K: \5 n0 ^; a , ?& |& b! `/ J9 A% k ) k: U/ x6 t. N' {3 N ! A7 c& q0 V5 K# ]$ h$ v# f% NRetrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/) @& c: C3 ?+ h4 q; s# [
0 K+ @) W' @3 q6 ~! _9 ZRetrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from http://rubygems.org/4 u$ u g0 E+ Z2 g, e
+ W' w! Q# v' g7 P U" T' I2 H4 {8 n: f4 u2 y" g
. d3 {& f& ]9 w7 W }9 U4 s r. g解决方案一:全局配置 Bundler 使用 Ruby China 镜像(HTTPS)" [" s( V; P6 _" ~( N
( r1 W8 f/ a% D7 r- Q3 u" y; b& F8 D - @( p3 t9 `1 g0 B7 T, q3 m; o3 h4 k7 D O7 C9 I9 P
bundle config set --global mirror.http://rubygems.org https://gems.ruby-china.com P& f# l# B5 f7 ^1 B( E/ P/ a
; }) }; d, ~/ S) c* v6 W, w
bundle config set --global mirror.https://rubygems.org https://gems.ruby-china.com 1 R' y4 O! z0 ~% s( H [/ J* {, r % C: v/ v, a3 I- i1 O( Q. x$ j , f! Q% C" B4 ]3 y; a4 }. Y/ j" R6 g, P1 X% j9 g# j( _ 验证配置: 6 |+ ?: m7 Y8 B: F8 T $ ?6 A6 q+ s) Q n, L8 r : @7 O& c! J. q4 o/ Y1 ` - s3 j# }7 x2 m) Jbundle config list- b( N9 l, f: H \* ~
* `: Q. [6 X, h 1 h7 Z6 E: w- I9 p$ [. j3 V/ [9 d 1 h9 F$ N1 a+ Y- b! W应看到类似:' C. `, {0 b4 y. r0 M3 m4 _
* o; d. h$ t/ `2 A
# O0 \, Q1 I6 q1 }- U: p" } a$ p: x5 Z9 E4 Q
Settings are listed in order of priority. The top value will be used. 8 G) v, c7 P t; s3 d- M% O1 R" g1 v1 H
mirror.http://rubygems.org& I- @1 R+ ]( b/ _1 L
# n2 x5 |. `+ F D
Set via BUNDLE_MIRROR__HTTP://RUBYGEMS__ORG: "https://gems.ruby-china.com"9 n2 n7 |# l# S m
! ?; R( C. R9 l' s
mirror.https://rubygems.org! {3 F2 c# g# `; {
+ ]. p: P* n+ m' U% _" P
Set via BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG: "https://gems.ruby-china.com"' j& ?) d2 b0 S) p5 f' h
6 e9 h* r. O W% Y. I
6 e+ n! Z7 L7 U/ r* \* i 8 Z2 w+ f% X% U4 k) f2 k # R( q6 u0 b: ~2 ` O) J E8 `( ^& O! O1 N# I S
把文件里面的:http://rubygems.org/ 改为 https://gems.ruby-china.com/- N& l r+ [* H, p6 T# ^
6 w/ h% Y; N. |5 B& i 7 C% [$ a& k. q7 T 9 b/ W# S% ]& C' s( y! a重新安装依赖并启动:6 T+ O" X' ]+ b' S. x9 s. v: K
- m* L% m) d! u) n- r( Z' x
7 I( L H" Y8 B. r2 H5 V Q
. o" a# Q. e2 R0 ]cd /home/root/dldl-gm && sh restart-alpha.sh 1 O. D9 a" T9 x* o$ s) L % C' p$ a- h% l0 g0 y# L - c/ c. K$ a3 E1 w * x3 m8 f. a9 T2 L" s应看到类似: ; @6 L( _8 X9 z4 B' X+ T1 P" w9 c( t- k. m' v! P6 [# w
& S/ d4 ^1 }7 _$ m. V! O) p1 X
) u+ p7 t5 n5 Q$ s$ @# p: Z- QDon't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this % C7 V8 r$ ]1 L6 `$ a' k8 _6 B: B+ E: l
application for all non-root users on this machine. D+ I m# e! n p4 z: u9 `6 i& [% b& Z5 e, J* n5 L
Fetching gem metadata from https://gems.ruby-china.com/.......... 3 [4 d" v& w* q* n! o2 } 0 Q' K' p- K' y# pFetching rake 12.3.1! F1 d2 |/ t7 h- b8 g. u8 o# Z3 \
2 T4 A/ }- {) s( \- y3 N7 R2 l
Installing rake 12.3.16 [8 W" Z& x' F
5 M6 y4 B5 M6 I. N7 S& D
Fetching concurrent-ruby 1.0.5" w& {4 I$ V8 r4 C& e
3 y7 ?5 g a" ?9 `$ F$ b& Z, v: F3 P7 Q
5 Z% O$ Z7 Q- S* O. k$ W恭喜您,这就是已经在正常安装依赖了!# G% E! _6 E+ ^3 n/ o- A0 ~* b3 V