我在Windows 8上安装了带有Gem 2.2.2的ruby 2.0.0p247 [x64-mingw32]。我有一个持续存在的问题gem,使它几乎无法使用。每当我尝试安装新宝石时,我总会得到:
ERROR: While executing gem ... Invalid spec cache file in C:/Users/...
过去,我已经能够运行gem update
或gem update --system
,这可以解决 one,single gem install
的问题。后续安装将失败并出现相同的错误。现在,即使gem更新失败,也会显示该错误消息。
我已尝试删除users/.../.gem
目录。当我这样做时,gem update
重新创建该目录并立即失败并显示相同的错误消息。
我用宝石多次重新安装ruby 1.9.8以试图解决问题,然后升级到ruby 2.0.0。在所有重新安装和升级过程中,问题仍然存在。
我的智慧在这里结束了。任何人都可以帮我解决这个问题吗?
这是编辑"
的回溯L:\xampp\htdocs\frameworks\yii2\framework>gem update --backtrace
Updating installed gems
ERROR: While executing gem ... (Gem::Exception)
Invalid spec cache file in C:/Users/Larry/.gem/specs/rubygems.org%443/specs.4.8
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:187:in `rescue in load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:179:in `load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:266:in `tuples_for'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:228:in `block in available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each_source'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:222:in `available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:113:in `fetch_remote_gems'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:135:in `highest_remote_version'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:264:in `block in which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:96:in `execute'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:167:in `process_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:137:in `run'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:54:in `run'
C:/Ruby200-x64/bin/gem:21:in `<main>'
答案 0 :(得分:0)
我遇到了同样的问题,但能够通过这种方式解决问题:
删除[{"Name": "Isa Andalu", "AC-No-PS-No-SLNo": " 47 - 391 - 455", "Gender": "F", "Age": "37", "Husband-Father": "Sataiah", "EPIC-No": "YZK0922831", "Door-No": "2-11-124/1"},
{"Name": "A RAJESH", "AC-No-PS-No-SLNo": " 47 - 391 - 456", "Gender": "M", "Age": "18", "Husband-Father": "A SATTAIAH", "EPIC-No": "YZK2535518", "Door-No": "2-11-124/1"},
{"Name": "BeeraM Venkatreddy", "AC-No-PS-No-SLNo": " 47 - 391 - 458", "Gender": "M", "Age": "33", "Husband-Father": "B Rangareddy", "EPIC-No": "YZK0700815", "Door-No": "2-11-124/2"}
]
中的文件夹,然后重新运行users/%user%/.gem/
希望这有帮助。