0

Platform: windows 7, running on JRuby 1.6.8.

C:\project> rake db:migrate
rake aborted!
You have already activated rake 10.0.3, but your Gemfile requires rake 0.9.2.2.
Using bundle exec may solve this.

OK. I have added

gem "rake", "= 0.9.2.2"

to Gemfile and ran:

C:\project> bundle exec rake db:migrate
bundler: command not found: rake
Install missing gem executables with `bundle install`

<polite>WTF?</polite>

I have also done

bundle install --deployment

to no avail.

I have different versions of rake installed:

C:\project>gem list

LOCAL GEMS
...
rake (10.0.3, 0.9.2.2, 0.8.7)

How to resolve this? I need rake db:migrate working with my specific (inherited) RoR project with gems that tend to be slightly out of date, but they are all specified in Gemfile.

LetMeSOThat4U
  • 6,470
  • 10
  • 53
  • 93

1 Answers1

0
  1. Don't run bundle --deployment until you clearly understand what it is used for. (it's confusing, we usually use bundle install --path vendor/bundle)

  2. The first error means, that you should execute your command with bundle exec, like bundle exec rake db:migrate

  3. after the version change in the Gemfile you should have just run bundle install without --deployment.

At this point I'd recommend to delete the .bundle folder in your project home, this reverses the --deployment call. Afterwards call bundle install and try it again. If it doesn't work please let us know.

Don't get frustrated, bundle is pretty cool as soon as you get the hang of it.

reto
  • 16,189
  • 7
  • 53
  • 67
  • 1
    that wasn't enough though: it appeared that newer activerecord version was a problem, I had to do what you wrote plus uninstall newer activerecord gem. THANKS!! – LetMeSOThat4U Feb 07 '13 at 17:05
  • And what if I had trouble with Passenger? According to [this](http://stackoverflow.com/questions/6648870/is-not-checked-out-bundle-install-does-not-fix-help) I should use --deployment. But after I've used it - I have error with "You have already activated rake 10.0.3". I even don't have this version in my gems list! But it apppears. – TiSer Mar 22 '13 at 13:05
  • @TiSer sorry, i don't have enough information (the post you link is almost two years old). Try to create a new question and specify more details. – reto Mar 22 '13 at 19:15