Hi everybody, I'm having a problem with devise here. Actually I must
be doing something very lame, because this was supposed to work.
Ok, I have a model User, and configured it to:
devise :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
Then I created the table with the following migration:
create_table :users do |t|
t.string :domain
t.string :name
t.string :permalink
t.database_authenticatable
t.confirmable
t.recoverable
t.rememberable
t.trackable
t.timestamps
t.timestamps
t.string :logo_file_name
t.string :logo_content_type
t.integer :logo_file_size
t.datetime :logo_updated_at
t.text :about
end
And added to routes.rb the following line:
devise_for :users
And then configured environment with:
config.gem "devise"
But when I run:
User.create(:name => "puelocesar", :email =>
"
puelo...@gmail.com", :password => "hild23")
I get the following error:
RuntimeError: Could not find a valid mapping for #<User:0x103580b70>
from /Library/Ruby/Gems/1.8/gems/devise-1.0.7/lib/devise/mapping.rb:
49:in `find_scope!'
from /Library/Ruby/Gems/1.8/gems/devise-1.0.7/app/models/
devise_mailer.rb:23:in `setup_mail'
from /Library/Ruby/Gems/1.8/gems/devise-1.0.7/app/models/
devise_mailer.rb:7:in `confirmation_instructions'
from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
base.rb:459:in `__send__'
from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
base.rb:459:in `create!'
from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
base.rb:452:in `initialize'
from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
base.rb:395:in `new'
from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
base.rb:395:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/devise-1.0.7/lib/devise/models/
confirmable.rb:60:in `send_confirmation_instructions'
And when I run rake routes, I get the following error:
rake aborted!
undefined method `devise_for' for main:Object
Can anyone help me on this one?