I am not loading a schema because of some restrictions in my gemset. Thus, I need to build my db with a migration.
Here’s the error when circleci runs rake:db:migrate
rake aborted!
failed to execute:
pg_dump -s -x -O -f /home/circleci/classtag-web/db/structure.sql test_app
Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions.
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/tasks/postgresql_database_tasks.rb:108:in `run_cmd'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/tasks/postgresql_database_tasks.rb:70:in `structure_dump'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:217:in `structure_dump'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/railties/databases.rake:277:in `block (3 levels) in <top (required)>'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/railties/databases.rake:67:in `block (2 levels) in <top (required)>'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.1/lib/active_record/railties/databases.rake:59:in `block (2 levels) in <top (required)>'
/home/circleci/classtag-web/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:structure:dump
(See full trace by running task with --trace)
Exited with code 1
My config:
version: 2
jobs:
build:
working_directory: ~/dir-to-test
docker:
- image: circleci/ruby:2.4.1-node
environment:
RAILS_ENV: test
- image: circleci/postgres:9.6-alpine
steps:
- checkout
# Restore bundle cache
- type: cache-restore
key: rails-demo-{{ checksum "Gemfile.lock" }}
# Bundle install dependencies
- run: bundle install --path vendor/bundle
# Store bundle cache
- type: cache-save
key: rails-demo-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Database setup
- run: bundle exec rake db:create
- run: bundle exec rake db:migrate
# Run rspec in parallel
- type: shell
command: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
# Save artifacts
- type: store_test_results
path: /tmp/test-results