【发布时间】:2014-03-27 14:41:16
【问题描述】:
我在 Windows 8 上安装了带有 Gem 2.2.2 的 ruby 2.0.0p247 [x64-mingw32]。我有一个持续存在的问题 gem,它几乎无法使用。每当我尝试安装新的 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 会重新创建该目录并立即失败并显示相同的错误消息。
我用 gems 重新安装了 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>'
【问题讨论】:
-
用路径和回溯粘贴完整的错误信息。
-
嗨@LarryTX 我遇到了同样的问题。有没有找到解决办法??提前致谢。
-
除了表示同情,我没有什么好说的。很抱歉你遇到这样的麻烦。您是从源安装还是使用 RailsInstaller?
-
什么是yii2? C:/Users/Larry/.gem/specs/rubygems.org%443/specs.4.8 的内容是什么?