首先,我在防火墙后面,所以我不能使用 https://rubygems.org/
$ bundle install rails
bundle install requires at least 0 argument: "bundle install".
git@gitdev $ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4)
Gem::RemoteFetcher::FetchError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (https://s3.amazonaws.com/production.s3.rubygems.org/gems/i18n-0.6.1.gem)
An error occurred while installing i18n (0.6.1), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.6.1'` succeeds before bundling.
我认为 bundler
使用 rubygems
所以我查看了 rubygems
来源:
$ gem source
*** CURRENT SOURCES ***
http://rubygems.org/
在 https://rubygems.org
之前
此设置使用 RVM
。使用全局 ruby 安装时,通过更改 gem
源,我能够安装 rails。所有 ssl 连接都被防火墙阻止,尤其是 github 和 aws。非 SSL 链接适用于我的环境。
所以问题是为什么 bundler
没有看到 gems
有一个非 ssl 的源?
最佳答案
检查你的 Gemfile,它必须有一行指定 bundler 使用的源:
source 'https://rubygems.org'
这是 bundler 使用的默认源。
关于ruby - 为什么 bundler 看不到自定义的 gem 源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17044038/