简体   繁体   中英

Migrations are pending

I'm trying to make validations for the users in my app but every time i try to migrate something or run a rake test it constantly gives me this error: rake aborted! ActiveRecord::PendingMigrationError:

Migrations are pending. To resolve this issue, run:

    bin/rake db:migrate RAILS_ENV=test

then when I run the command " bin/rake db:migrate RAILS_ENV=test" it says permission denied. Can someone please help me! ( Im working in cloud9 and following the Mhartl guide currently on chapter 6)

You should be able to run:

bundle exec rake db:migrate

...and it will automatically run for your dev environment/database. Not sure why you're telling it to run in the test ENV. If you can access your dev database and run your app in your browser you clearly have enough permissions to access the database. If your issue comes when running tests you can do:

bundle exec rake db:test:prepare

That will get your test schema where it needs to be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM