Error rake db: create

1

Good afternoon,

I am using a program from another person developed in Ruby on Rails and after giving bundle install to the project folder and installing all gems , I tried to create the database through the commands:

rake db:create and rake db:migrate

However, the following error is occurring:

  

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

I looked for some solution but could not solve it

    
asked by anonymous 24.06.2015 / 21:27

1 answer

3

This is because you are using rake version 10.4.2 and the system is requesting version 10.3.1.

You have 2 options:

1) Uninstall the current gem and install the version the program is requesting.

  • open cmd and navigate to your project directory
  • type the command: gem uninstall rake -v 10.4.2
  • type the command: gem install rake -v 10.3.1

2) Change the Gemfile files of your project, where you are specifying the rake version to 10.3.1 and change to 10.4.2

After one of these two options run bundle install so that the gems can be updated, according to the new version of rake. Then retry the procedure you want.

    
24.06.2015 / 21:49