I'm trying to make demo restful json api
using this link:
https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one
but when i try to execute the following command
bundle exec rspec
ActiveRecord :: PendingMigrationError
error generated
I tried many solutions available in stack overflows, but no effect so far
C: \ ruby ββ\ imran-api> bundle exec rspec C: /Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb: 573: in `check_pending! ': (ActiveRecord :: PendingMigrationError)
Migrations are pending. To fix this problem, run:
bin/rails db:migrate RAILS_ENV=test from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb:586:in `load_schema_if_pending!' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb:592:in `block in maintain_test_schema!' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb:823:in `suppress_messages' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb:597:in `method_missing' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.2/lib/active_record/migration.rb:592:in `maintain_test_schema!' from C:/ruby/imran-api/spec/rails_helper.rb:27:in `<top (required)>' from C:/ruby/imran-api/spec/controllers/items_controller_spec.rb:1:in `require' from C:/ruby/imran-api/spec/controllers/items_controller_spec.rb:1:in `<top (required)>' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `load' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435:in `block in load_spec_files' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433:in `load_spec_files' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:100:in `setup' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86:in `run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:71:in `run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:45:in `invoke' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/exe/rspec:4:in `<top (required)>' from C:/Ruby23-x64/bin/rspec:22:in `load' from C:/Ruby23-x64/bin/rspec:22:in `<main>'
full error image
source share