# ODK Build Error with rake db:migrate

**URL:** <https://forum.getodk.org/t/odk-build-error-with-rake-db-migrate/26806>\
**Category:** Development\
**Tags:** odk-build\
**Created:** [May 26, 2020, 12:42pm UTC](https://forum.getodk.org/t/odk-build-error-with-rake-db-migrate/26806 "2020-05-26T12:42:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elena\_Grygorova](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/elena_grygorova/32/11493_2.png) [@Elena\_Grygorova](https://forum.getodk.org/u/Elena_Grygorova)\
**Post date:** [May 26, 2020, 12:42pm UTC](https://forum.getodk.org/t/odk-build-error-with-rake-db-migrate/26806/1 "2020-05-26T12:42:05Z")

</div>

Hi everyone,

I'm completely new to Ruby and ODK and I try to install ODK Build (OS: Windows 10). I successfully ran bundle install, but when I run the command "bundle exec rake db:migrate", there is a following error:

\*\* Invoke db:migrate (first\_time)  
\*\* Execute db:migrate  
rake aborted!  
NoMethodError: undefined method `[]' for nil:NilClass C:/Users/elly1/Documents/Uni/Hiwi-Job/ODK-Build/build/server/model/connection_manager.rb:26:in `open\_connections\_if\_necessary!'  
C:/Users/elly1/Documents/Uni/Hiwi-Job/ODK-Build/build/server/model/connection\_manager.rb:15:in `call' C:/Users/elly1/Documents/Uni/Hiwi-Job/ODK-Build/build/server/model/connection_manager.rb:49:in `rackless\_connection'  
C:/Users/elly1/Documents/Uni/Hiwi-Job/ODK-Build/build/Rakefile:49:in `block (2 levels) in <top (required)>' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain' C:/Ruby26-x64/lib/ruby/2.6.0/monitor.rb:235:in `mon\_synchronize'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top\_level'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top\_level'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top\_level'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard\_exception\_handling'  
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `\<top (required)\>'  
C:/Ruby26-x64/bin/rake:23:in `load' C:/Ruby26-x64/bin/rake:23:in `'  
Tasks: TOP =\> db:migrate  
Error closing Postgres connection. Some minor data loss may have occurred for in-flight transactions.

My config.yml file:

version: 2.0  
jobs:  
build:  
docker:  
- image: circleci/ruby:2.3.3  
working\_directory: ~/work  
steps:  
- checkout  
- restore\_cache:  
key: v1-gems-{{ checksum "Gemfile.lock" }}  
- run:  
name: Install dependencies  
command: |  
sudo apt-get update  
sudo apt-get install -y zlib1g-dev libbz2-dev default-jre  
- run:  
name: Install and deploy  
command: |  
cp config.yml.sample config.yml  
bundle install --path vendor/bundle  
bundle exec rake deploy:build  
echo $CIRCLE\_SHA1 \> .build\_rev  
tar jcf build.tar.bz2 \* .build\_rev .build\_time  
- store\_artifacts:  
path: /home/circleci/work/build.tar.bz2  
- save\_cache:  
key: v1-gems-{{ checksum "Gemfile.lock" }}  
paths:  
- /home/circleci/work/vendor/bundle  
notify:  
webhooks:  
- url: "[http://staging.build.opendatakit.org:5566/deploy](http://staging.build.opendatakit.org:5566/deploy)"  
experimental:  
notify:  
branches:  
only:  
- "staging"

workflows:  
version: 2  
build:  
jobs:  
- build

development:  
cookie\_secret: sample  
cookie\_ssl\_only: false  
database:  
host: localhost  
database: odkbuild  
user: odkbuild  
password: odkbuild

test:  
cookie\_secret: sample

staging:  
cookie\_secret: sample

production:  
cookie\_secret: sample  
google\_analytics\_id: UA-12345678-9

Does anyone have some idea?

Regards,

Elena
