Question

I'm working on the onemonthrails course and have an issue with the rake db:migrate command after generating the users model with Devise. When I run the command itself it seems like nothing happens, no error, no message regarding the migration.

Running with --trace I get the following:

$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

That's it. After the last execute line it just goes back to the command prompt. I've checked the lesson and can't find anything wrong.

The repo is here, https://github.com/CoreyT355/onemonthrails

Was it helpful?

Solution 2

I found a fix for this myself after some playing around.

For anyone in the course at least, the steps say after installing Devise to then add the devise views. i.e. rails g devise:views

Then to create the user model, i.e. rails g devise user

Then run the migration i.e. rake db:migrate

Those steps do not follow the devise documentation and it appears they need to be in a specific order (though I am not knowledgeable enough to know why yet).

The order should be as follows:

rails g devise user
rake db:migrate
rails g devise:views

That worked for me at least. Hope this helps someone eventually.

OTHER TIPS

I just had this issue, and the migration generated by devise just didn't have the extension .rb. It is supposedly merged into master, not quite sure why i got it.

https://github.com/plataformatec/devise/issues/2874

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