user1447825
user1447825

Reputation:

Issue with "rake" and won't connect to database

I have a rails app i've been working on for a while and it was always working and testing fine. Then for some reason today when I tried rake db:migrate I get the message below. I have started using git recently. Whether that has anything to do with it I don't know.

Gem::LoadError: You have already activated rake 10.5.0, but your Gemfile requires rake 10.4.2. Prepending bundle exec to your command may solve this.

If i type bundle exec rake db:migrate it seems to complete the migration the issue now is that in the new view when the user hits the submit button the create action isn't called. So the data isn't entered into the database.

Any ideas would be great. Thanks.

Upvotes: 1

Views: 2621

Answers (2)

tropikan4
tropikan4

Reputation: 131

In my case

  1. I used existing rvm gemset for new project
  2. After bundle install (for new project) I had rake (10.5.0) in new project's Gemfile.lock
  3. Old project is more important so I uninstalled rake 10.5.0 rvm gemset use <gemsetname>; gem uninstall rake + select 10.5.0 (asked in console)
  4. rake (10.4.2) in new project's Gemfile.lock

Upvotes: 0

Shubham Abrol
Shubham Abrol

Reputation: 623

You have to run bundle update on the terminal. I was also facing the same issue but after bundle update everything got fixed.

Upvotes: 8

Related Questions