Bundler找不到gem的版本,但使用相同名称的gem安装有效 [英] Bundler cannot find a version of a gem, but gem install with the same name works

查看:178
本文介绍了Bundler找不到gem的版本,但使用相同名称的gem安装有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个gem,由于某种原因,它一直困扰着我,并且拒绝通过捆绑程序正确安装。

I've created a gem, and for some reason this one keeps bugging me, and refuses to install properly through bundler.

这里是 Gemfile

source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem "switch_access-rails", "~> 1.1.6"

捆绑安装失败,并显示以下信息:

bundle install fails with:

Could not find gem 'switch_access-rails (~> 1.1.6) ruby' in the gems available on this machine.

这有效:

gem install switch_access-rails -v 1.1.6 

gem在这里在rubygems上: https://rubygems.org/gems/switch_access-rails/versions/ 1.1.6

And the gem is here on rubygems: https://rubygems.org/gems/switch_access-rails/versions/1.1.6

我什至尝试从版本1.1.5升级到1.1.6只是为了看看是否有帮助。

I even tried bumping from version 1.1.5 to 1.1.6 just to see if that helped.

在捆绑安装程序中安装1.1.4版本。

Installing version 1.1.4 in with bundle install works.

关于从哪里开始查找/调试软件包安装的任何提示?

Any tips on where to start looking/debugging bundle install?

推荐答案

经过一整天的搜索,我发现此状态从12月12日开始更新: http://twitter.com / ruby​​gems_status / status / 279019743166476288

And after a whole day of googling I found this status update from Dec 12: http://twitter.com/rubygems_status/status/279019743166476288

bundle install --full-index

似乎直接从rubygems而不是从云端缓存中获取索引。

Seems to get the index directly from rubygems instead of from a cloudfront cache.

我看了一下索引,两个索引有很大的不同,因此,如果您刚刚发布了gem或使用了新发布的gem,则可能必须添加--full-index才能获得正确的索引

I had a look at the index, and there is quite a diffence in the two indexes, so if you just released a gem or use a newly released gem, you might have to add --full-index in order to get the proper index.

这篇关于Bundler找不到gem的版本,但使用相同名称的gem安装有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆