undefined method `devise_for' for

878 views
Skip to first unread message

ldk

unread,
Sep 3, 2010, 9:00:22 PM9/3/10
to Devise
I'm currently running with rails 3.0.0 and ruby 1.9.2 and I have
followed the installation steps:

gem install devise
rails generate devise:install
rails generate devise User
rake db:migrate

-----

after the devse:install step, and before the "rails generate User" I
did the following:

added config.action_mailer.default_url_options = { :host => 'localhost:
3000' }
added route: root :to => "contacts#index"
added <p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>

----

when I go to /contacts I get the following:

undefined method `devise_for' for #<ActionDispatch::Routing::Mapper:
0x0000010139aa88>

application trace:
config/routes.rb:2:in `block in <top (required)>'
config/routes.rb:1:in `<top (required)>'

----

When I comment out the line with "devise_for" the problem goes
away..., my app goes back to normal. Any ideas on what to do?

Carlos Antonio da Silva

unread,
Sep 3, 2010, 9:11:33 PM9/3/10
to plataforma...@googlegroups.com
Hey, how is your Gemfile?
--
At.
Carlos A. da Silva

ldk

unread,
Sep 7, 2010, 12:32:15 PM9/7/10
to Devise
source 'http://rubygems.org'

gem 'rails', '3.0.0'

gem 'sqlite3-ruby', :require => 'sqlite3'

gem "haml"
gem "haml-rails"

gem "devise"

On Sep 3, 9:11 pm, Carlos Antonio da Silva

Carlos Antonio da Silva

unread,
Sep 7, 2010, 2:24:30 PM9/7/10
to plataforma...@googlegroups.com
Be sure you fix the gem versions you're using.
Try removing your Gemfile.lock, and point devise to 1.1.2 version, then bundle it again.

ldk

unread,
Sep 7, 2010, 5:08:19 PM9/7/10
to Devise
Wow, it magically works now after following your advice. I'm not sure
why it wasn't working before -- I was using 1.1.2 then.

Thanks for your help, great gem by the way!

On Sep 7, 2:24 pm, Carlos Antonio da Silva
Reply all
Reply to author
Forward
0 new messages