I'm going through Ruby on Rails tutorial.
I created application, model, controller. I used rake db:migrate
, and, as the book stated - replaced file development.sqlite3
in db
directory with the one they provided.
Now, when I want to see my site, I get an error: Migrations are pending. To resolve this issue, run:
bin/rake db:migrate RAILS_ENV=development
When I run it, I receive message: can't be done, table ads already exists. What should I do?
Table ads are already there on your db and in pending migration again creae ads table so you got the error.
you can try.
rake db:reset RAILS_ENV=development
It does db:drop, db:setup
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.