本文介绍了为什么bundler没有看到定制的宝石来源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我是在防火墙后面,所以我不能使用 https://rubygems.org/

  $ bundle install rails 
undle安装需要至少0个参数:bundle install。
git @ gitdev $ bundle install
从https://rubygems.org/获取gem元数据/ ...........
从https:// ruby​​gems中获取gem元数据.org / ..
解析依赖关系...
使用rake(10.0.4)

Gem :: RemoteFetcher :: FetchError:SSL_connect SYSCALL返回= 5 errno = 0状态= SSLv2 / v3读取服务器hello A(https://s3.amazonaws.com/production.s3.rubygems.org/gems/i18n-0.6.1.gem)
安装i18n时发生错误(0.6。 1)和Bundler无法继续。
确保`gem install i18n -v'0.6.1'`捆绑成功。

我认为 bundler 使用 ruby​​gems 所以我查看了 ruby​​gems 来源:

  $ gem source 
***当前来源***
http://rubygems.org/

之前它是 https://rubygems.org



安装程序使用 RVM 。当使用全局ruby安装时,通过更改 gem 源代码,我可以安装rails。所有ssl连接都被防火墙封锁,尤其是github和aws。非ssl链接适用于我的环境。



所以问题是为什么 bundler 没有看到 gems 有一个非ssl的源代码?

解决方案

检查你的Gemfile,它可能会有一行指定bundler使用的源代码:


$ b

  source'https:// ruby​​gem。 org'

这是bundler使用的默认源码。您可以将其编辑为指向非HTTPS网站。


First of all the thing is that I'm behind firewall so I can't use 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.

I thought that bundler uses rubygems so I looked at rubygems sources:

$ gem source
*** CURRENT SOURCES ***
http://rubygems.org/

before it was https://rubygems.org

This setup is using RVM. When using global ruby installation, by changing gem source, I was able to install rails. All ssl connection blocked by firewall especially github and aws. Non-ssl links works in my environment.

So question is why bundler doesn't see that gems has a non-ssl'ed source?

解决方案

Check you Gemfile, it might have a line specifying the source used by bundler:

source 'https://rubygem.org'

This is the default source used by bundler. You can edit it to point to a non-HTTPS site.

这篇关于为什么bundler没有看到定制的宝石来源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 06:01