Search code examples
ruby-on-railsrubyactiverecordrakedbmigrate

Rails rake db:migrate of a recently created database


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?


Solution

  • 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.