# Database create/schema/load command fails due to error "Could not find rake-12.0.0 in any of the sources"

**URL:** <https://discuss.circleci.com/t/database-create-schema-load-command-fails-due-to-error-could-not-find-rake-12-0-0-in-any-of-the-sources/14394>\
**Category:** Databases\
**Created:** [July 17, 2017, 10:52am UTC](https://discuss.circleci.com/t/database-create-schema-load-command-fails-due-to-error-could-not-find-rake-12-0-0-in-any-of-the-sources/14394 "2017-07-17T10:52:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharomi1](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@sharomi1](https://discuss.circleci.com/u/sharomi1)\
**Post date:** [July 17, 2017, 10:52am UTC](https://discuss.circleci.com/t/database-create-schema-load-command-fails-due-to-error-could-not-find-rake-12-0-0-in-any-of-the-sources/14394/1 "2017-07-17T10:52:58Z")

</div>

We just upgraded our rails application from rails 4.2.4. to 5.1.0 and of course had to make some changes in our configuration to get it up and running on our local development station and on CricleCI. Our current problem is that the build constantly fails on Circle on the ‘database’ phase.

**The stack i’m using**  
Ruby 2.3.1, Rails 5.1.0

**The exact error i’m getting**  
’’’  
$ bundle exec rake db:create db:schema:load db:seed

Could not find rake-12.0.0 in any of the sources  
Run `bundle install` to install missing gems.

bundle exec rake db:create db:schema:load db:seed returned exit code 7  
Action failed: bundle exec rake db:create db:schema:load db:seed  
’’’

**Troubleshooting steps already taken**  
Tried several things that were found in some forums including:  
Upgraded node version  
Specified Rake version 12.0.0  
Replace rake command with rails  
Added some lines to dependencies/pre phase found in the following links: [1|https://discuss.circleci.com/t/formerly-passed-tests-failed-due-to-missing-rake-gem/10635],[2|https://discuss.circleci.com/t/formerly-passing-build-now-fails/9590/5]

**Any recent changes either in the codebase or the stack**  
None except upgrading to rails 5.1.0

**What happens when you run the tests locally**  
Fails due to a different reason, probably unrelated  
’’‘  
rake aborted!  
ActiveRecord::NoEnvironmentInSchemaError:  
’’'  
**What is supposed to happen when your build runs**  
Database phase should complete successfully and then the testing phase should begin (with test either failing or succeeding - we are still stuck in the database phase though)

**Circle.yml file (indentation is correct, just isn’t displayed properly)**  
’’‘  
machine:  
environment:  
APIARY\_API\_KEY: "123…abc"  
ruby:  
version: 2.3.1  
node:  
version: 6.0.0  
dependencies:  
cache\_directories:  
- ~/.cache/yarn  
override:  
- yarn  
pre:  
- npm install -g dredd@stable  
- gem install apiaryio  
- pip install dredd\_hooks  
database:  
override:  
- bundle exec rake db:create db:schema:load db:seed  
test:  
override:  
- yarn test  
pre:  
- apiary fetch --api-name=abc…123 --output=api-description.yml  
- dredd  
deployment:  
staging:  
branch: master  
commands:  
- “[[! -s “$(git rev-parse --git-dir)/shallow”]] || git fetch --unshallow”  
- git push [git@heroku.com](mailto:git@heroku.com):abc…def.git $CIRCLE\_SHA1:master  
- heroku run rake db:migrate db:seed --app abc…def  
’’’

---

<div class="post-metadata">

**Author:** ![mrjonesbot](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mrjonesbot](https://discuss.circleci.com/u/mrjonesbot)\
**Post date:** [July 25, 2017, 1:47am UTC](https://discuss.circleci.com/t/database-create-schema-load-command-fails-due-to-error-could-not-find-rake-12-0-0-in-any-of-the-sources/14394/2 "2017-07-25T01:47:58Z")

</div>

I was able to resolve this error for myself by running,

`bundle update rake`

in my project directory, then adding the following to my circle.yml file:

```
database:
  override:
    - bundle install
    - bundle exec rake db:create db:schema:load db:seed
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:32am UTC](https://discuss.circleci.com/t/database-create-schema-load-command-fails-due-to-error-could-not-find-rake-12-0-0-in-any-of-the-sources/14394/3 "2018-06-18T11:32:38Z")

</div>


