Schema:load invalid option: --trace


#1

Rails 4, Postgres, & MiniTest I’ve started getting this failure which doesn’t happen locally. When I ssh and execute bundle exec rake db:schema:load with the --trace option, it works. I don’t know how to tell Circle not to use the trace option.

export RAILS_ENV="test"
export RACK_ENV="test"
bundle exec rake db:create db:schema:load --trace
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config 
** Execute db:schema:load
-- enable_extension("plpgsql")
   -> 0.0140s
-- create_table("attachments", {:force=>:cascade})
   -> 0.0049s
-- add_index("attachments", ["attachable_id", "attachable_type"], {:name=>"index_attachments_on_attachable_id_and_attachable_type", :using=>:btree})
   -> 0.0028s
-- create_table("devices", {:force=>:cascade})
   -> 0.0031s
-- add_index("devices", ["firmware_version"], {:name=>"index_devices_on_firmware_version", :using=>:btree})
   -> 0.0018s
-- add_index("devices", ["lot_id"], {:name=>"index_devices_on_lot_id", :using=>:btree})
   -> 0.0018s
-- add_index("devices", ["prescription_id"], {:name=>"index_devices_on_prescription_id", :using=>:btree})
   -> 0.0017s
-- create_table("events", {:force=>:cascade})
   -> 0.0042s
-- add_index("events", ["eventable_id", "eventable_type"], {:name=>"index_events_on_eventable_id_and_eventable_type", :using=>:btree})
   -> 0.0027s
-- add_index("events", ["occurred_at"], {:name=>"index_events_on_occurred_at", :using=>:btree})
   -> 0.0021s
-- add_index("events", ["type"], {:name=>"index_events_on_type", :using=>:btree})
   -> 0.0018s
-- create_table("lots", {:force=>:cascade})
   -> 0.0026s
-- add_index("lots", ["production_date"], {:name=>"index_lots_on_production_date", :using=>:btree})
   -> 0.0018s
-- create_table("permissions", {:force=>:cascade})
   -> 0.0030s
-- create_table("prescriptions", {:force=>:cascade})
   -> 0.0026s
-- add_index("prescriptions", ["device_id"], {:name=>"index_prescriptions_on_device_id", :using=>:btree})
   -> 0.0019s
-- add_index("prescriptions", ["hcp_id"], {:name=>"index_prescriptions_on_hcp_id", :using=>:btree})
   -> 0.0018s
-- add_index("prescriptions", ["patient_id"], {:name=>"index_prescriptions_on_patient_id", :using=>:btree})
   -> 0.0018s
-- create_table("roles", {:force=>:cascade})
   -> 0.0029s
-- create_table("short_paths", {:force=>:cascade})
   -> 0.0067s
-- add_index("short_paths", ["short_path"], {:name=>"index_short_paths_on_short_path", :using=>:btree})
   -> 0.0019s
-- create_table("user_roles", {:force=>:cascade})
   -> 0.0021s
-- add_index("user_roles", ["role_id"], {:name=>"index_user_roles_on_role_id", :using=>:btree})
   -> 0.0018s
-- add_index("user_roles", ["user_id"], {:name=>"index_user_roles_on_user_id", :using=>:btree})
   -> 0.0018s
-- create_table("users", {:force=>:cascade})
   -> 0.0061s
-- add_index("users", ["confirmation_token"], {:name=>"index_users_on_confirmation_token", :unique=>true, :using=>:btree})
   -> 0.0019s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true, :using=>:btree})
   -> 0.0018s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true, :using=>:btree})
   -> 0.0018s
-- add_index("users", ["type"], {:name=>"index_users_on_type", :using=>:btree})
   -> 0.0018s
-- add_index("users", ["unlock_token"], {:name=>"index_users_on_unlock_token", :unique=>true, :using=>:btree})
   -> 0.0018s
-- initialize_schema_migrations_table()
   -> 0.0051s

invalid option: --trace

minitest options:
    -h, --help                       Display this help.
    -s, --seed SEED                  Sets random seed. Also via env. Eg: SEED=n rake
    -v, --verbose                    Verbose. Show progress processing files.
    -n, --name PATTERN               Filter run on /regexp/ or string.

Known extensions: minitest_reporter, ci, guard_minitest, pride
        --ci-dir DIR                 Set the CI report dir. Default to test/reports
        --[no-]ci-clean              Clean the CI report dir in between test runs. Default true
    -p, --pride                      Pride. Show your testing pride!

export RAILS_ENV="test"
export RACK_ENV="test"
bundle exec rake db:create db:schema:load --trace
 returned exit code 1

Action failed: rake db:create db:schema:load

#2

I am having the same issue. I tried;

database:
  override:
    - bundle exec rake db:create db:schema:load

but that failed since can’t find database.yml

can’t get it working cp config/database.yml.ci config/database.yml, default inference actually echo to config. Don’t know how to add that step in manual.


#3