Skip to content

Instantly share code, notes, and snippets.

@saberma
Created August 9, 2010 15:05
Show Gist options
  • Save saberma/515543 to your computer and use it in GitHub Desktop.
Save saberma/515543 to your computer and use it in GitHub Desktop.
Could not find gem 'sentient_user (>= 0, runtime)' in any of the gem sources.
require 'rubygems/spec_fetcher'
files = { :latest => 'latest_specs',
:prerelease => 'prerelease_specs',
:all => 'specs' }
source = Gem.sources.first
all_gems = Gem::SpecFetcher.new.load_specs(URI.parse(source), files[:all]).map{|g| g[0]}
latest_gems = Gem::SpecFetcher.new.load_specs(URI.parse(source), files[:latest]).map{|g| g[0]}
puts "Does all spec has sentient_user gem? #{all_gems.select{|g| g =~ /sentient_user/ }.size > 0}"
puts "Does latest spec has sentient_user gem? #{latest_gems.select{|g| g =~ /sentient_user/ }.size > 0}"
@saberma
Copy link
Author

saberma commented Oct 9, 2012

Gem.latest_rubygems_version

切换 VPN 后要删除 ~/.gem/specs/rubygems.org%80/ 中的文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment