Rails rake db:migrate of a recently created database
-
04-07-2021 - |
문제
I have just created a database. I am trying to migrate but I am receiving a table not found error.
rake db:migrate
/usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:211: warning: Insecure world writable dir /usr/local/rvm/gems in PATH, mode 042777
rake aborted!
Mysql2::Error: Table 'law_development.users' doesn't exist: SHOW FIELDS FROM `users`
Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)
That table is created by the first migration, the database is empty (without tables).
Any help?
해결책
There are number of reasons for this behavior. If above stated solutions didn't worked for you, then first of all try running:
rake db:migrate --trace
Examine the logs generated, definitely there would be some code that breaks migrations.
For more info you can consult this forum.
다른 팁
Try starting with a clean database, and loading the schema directly instead of running the migrations:
rake db:drop db:create db:schema:load
제휴하지 않습니다 StackOverflow