title: Can't fix Active Record Pending Migration Error
body: <p><strong>i am trying to make a demo restful json api</strong></p>
  <p>using this link:</p>
  <p><a href="https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one" rel="nofollow noreferrer">https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one</a></p>
  <p>but when i trying to run following command</p>
  <pre><code>$ bundle exec rspec
  
  ActiveRecord::PendingMigrationError
  
  error generated
  
  i tried many solution available in stack overflow but no effect happen so far
  
  
  
  C:\ruby\imran-api&gt;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 resolve this issue, 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 `&lt;top (required)&gt;'
          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 `&lt;top (required)&gt;'
          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 `&lt;top (required)&gt;'
          from C:/Ruby23-x64/bin/rspec:22:in `load'
          from C:/Ruby23-x64/bin/rspec:22:in `&lt;main&gt;'
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Rmtwc.png" rel="nofollow noreferrer">full error picture</a></p>