Pregunta

I'm working on a legacy Rails 2.3.8 project and setting up a dev server.

I get errors when I try to run rake, and I realized I have the wrong version of Rake installed, in the Rakefile it says:

s.add_dependency 'rake', '>= 0.7.1'

and I have 0.9.2.2 installed. When I try to uninstall, I get

ERROR: While executing gem ... (Gem::InstallError) cannot uninstall, check gem list -d rake

I don't have RVM installed, and all the posts I see related to fixing this problem mentioned RVM, so I'm stuck.

¿Fue útil?

Solución

I came across this error myself. I don't know why it happened, but I did figure out how to fix it.

It is giving an error because it's got a gemspec record without the actual gem in the gem directory.

You can fix this by manually deleting the gemspec in your gem directory.

First you need to figure out where the gem thinks it's located. You can probably do this with:

 echo $GEM_PATH

If you are on *nix, you can also try /usr/lib/ruby/gems/

Otherwise google to figure out how to find your gem directoy.

the gem directory has subdirs, the ones that I found relevant for fixing this were: gems specifications and cache

You're looking for something like rake-0.9.2.2

If the gem were to be found in gems then it would have uninstalled for me, but it wasn't. However I did find rake-0.9.2.2.gemspec in specifications and rake-0.9.2.2.gem in cache. When I deleted both of these, I stopped getting the error message.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top