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.
Don’t run
bundle --deploymentuntil you clearly understand what it is used for. (it’s confusing, we usually usebundle install --path vendor/bundle)The first error means, that you should execute your command with
bundle exec, likebundle exec rake db:migrateafter the version change in the
Gemfileyou should have just runbundle installwithout--deployment.At this point I’d recommend to delete the
.bundlefolder in your project home, this reverses the--deploymentcall. Afterwards callbundle installand 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.