novato: mensaje de error cuando 'rake -T'

Estoy utilizando Edición Ruby Enterprise for my project. When I check all my tarea de rastrillo by run the command rake -T , Recibí el siguiente mensaje de error:

You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.

The error message implies that I can use paquete ejecutivo to solve the problem, but I am not sure how? So, how to get rid of this error message?

------------------------------ more ---------------------------

I prefer to update my Gemfile instead of run bundle exec rake -T. But when I open my project Gemfile, I did not see rake 0.9.2 in my Gemfile, why the error message complains that I have it? Where could be the place I defined rake 0.9.2??

preguntado el 08 de noviembre de 11 a las 12:11

2 Respuestas

Corral bundle exec rake -T, this ensures that the version of rake that is specified in your Gemfile is running, not another version.

Alternatively, update your Gemfile.

respondido 08 nov., 11:16

I prefer to update my Gemfile, but I dont have rake 0.9.2 in my Gemfile, why the error message complain that I have it? Where could be the place I defined rake 0.9.2?? - Mellon

Mellon, check your Gemfile.lock. You probably updated rake after running bundle install. correr bundle update rake to update the Gemfile.lock. - Harald

Harald, Thanks, it now works. Could you also please explain to me why rake is not defined in my Gemfile but in Gemfile.lock? Isn't it a gem? - Mellon

Mellon, Gemfile describes the immediate dependencies your project depends on. Gemfile.lock records the actual versions of those dependencies and all dependencies of those again. This is to allow bundle install to recreate your exact environment so you don't get any unpleasant surprises when deploying your app. - Harald

Esto es porque tu rake tool does not match the version written in the Gemfile.

You first need to run this command, to ensure rake 0.9.2 get installed:

bundle install

Then, you can run rake 0.9.2 with the following command:

bundle exec rake -T

El bundle thing is a nice tool to help you manage the dependency of your application. You can get more info from aquí.

respondido 08 nov., 11:16

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.