I wasn't able yet to figure out why the rake task was not behaving as expected. I suspect it has to do with the order stuff is being loaded being changed with Rails 4, but I am not sure yet. This works.