rails new 时遇到的问题

2015-05-14 11:37:51 +08:00
 anthonyeef

执行rails new blog后,出现下面的反馈:

Gem::RemoteFetcher::FetchError: Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.
run bundle exec spring binstub --all
bundler: command not found: spring
Install missing gem executables with `bundle install`

搜了一下没有找到很清楚的解释,有人能帮忙解决一下吗?

3174 次点击
所在节点    问与答
10 条回复
ChiangDi
2015-05-14 11:42:38 +08:00
被墙了,换淘宝源。
fantasticfears
2015-05-14 11:46:28 +08:00
windfarer
2015-05-14 11:48:34 +08:00
编辑项目下的gemfile,换淘宝源,然后再 bundle install
anthonyeef
2015-05-14 12:55:57 +08:00
@ChiangDi
@windfarer
@fantasticfears 我有用shadowsocksX进行全局翻墙,真的是因为被墙的原因吗?
windfarer
2015-05-14 13:26:57 +08:00
@anthonyeef 即使是shadowsocks全局翻墙,terminal里的东西也不是走ss,而是会直连。terminal下想用ss,可以用这个。不过大家一般应该都是改淘宝源来解决这个问题。
https://github.com/rofl0r/proxychains-ng
karloku
2015-05-14 13:29:38 +08:00
看错误码就是https://rubygems.org/被墙(因为rubygems的仓库serve在aws上)
rails new的时候带上-B [--skip-bundle]参数, 跳过bundler
Gemfile里改成https://ruby.taobao.org/

ss不是万能的, gem这样的cli工具默认不会走系统代理
anthonyeef
2015-05-14 21:47:23 +08:00
@karloku 我把gem源换成淘宝源了,也改了Gemfile,但bundle install后还是长时间的没有反应。焦头烂额啊……
anthonyeef
2015-05-14 22:09:08 +08:00
@ChiangDi
@fantasticfears
@windfarer
@karloku 换淘宝源后经过漫长等待后可以了:)小铜币送上以示感谢:)
linhua
2015-05-20 00:13:14 +08:00
@anthonyeef
翻墙后也是有问题的,其实是https有问题,换成http就好了。可参考
http://stackoverflow.com/questions/10246023/bundle-install-fails-with-ssl-certificate-verification-error
anthonyeef
2015-05-20 00:19:54 +08:00
@linhua 谢谢你,我明天试一下。小铜币送上。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/190996

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX