Invalid spec cache file

I have ruby ​​2.0.0p247 [x64-mingw32] with Gem 2.2.2 installed on Windows 8. I have a persistent problem that makes it almost unusable. Whenever I try to install a new stone, I always get:

ERROR: While executing gem ... Invalid spec cache file in C:/Users/...

In the past, I managed to run gem updateor gem update --system, and that would fix the problem for one, single gem install . Subsequent installation will fail with the same error. Now even the gem update fails with this error message.

I tried to delete the directory users/.../.gem. When I do this, it gem updaterecreates this directory and quickly fails with the same error message.

I reinstalled ruby ​​1.9.8 with gems several times to try to cure the problem and then upgraded to ruby ​​2.0.0. In all reinstallations and updates, the problem persists.

I'm here. Can someone help me solve this problem?

Here's the backtrack on edit "

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>'
+4
source share
1 answer

I had the same problem, but I was able to fix it as follows:

Delete the folder in users/%user%/.gem/and run the commandgem sources --update

Hope this helps.

0
source

Source: https://habr.com/ru/post/1533751/


All Articles