Question

I am working on the onemonthrails course.

I need to execute a migration using the below rake command. The devise migration file looks to be setup correctly.

   rake db:migrate

I am expecting to see some kind of confirmation like the following:

=======DeviseCreateUsers:  Migrating=======
create table (:users)
-> 0.0145s
add_index (:users :index  etc...
etc..

Instead, my terminal reverts straight back to the command line (with no errors) but nothing appears to have been done. For example:

Petes-Computer:example Pete$ rake db:migrate
Petes-Computer:example Pete$ 

The below error in my browser confirms it didn't work.

ActiveRecord::StatementInvalid in Devise::RegistrationsController#new
Could not find table 'users'

There are a couple of other posts on this but no luck resolving. I am very new to ruby/rails/rake; please could someone advise.

Was it helpful?

Solution

After our discussion, it turns out Pete's migration file didn't have an extension. rake db:migrate didn't pick up the migration because it wasn't an .rb file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top