title: Migrating to OmniAuth 1.0: undefined method `user_omniauth_authorize_path'
body: <p>Trying to migrate my app from <strong>Rails 3.0 to 3.2</strong>, and as part of this I'm also updating Devise gem. Turned out that new Devise requires new <strong>OmniAuth</strong> gem. I have Facebook authorization configured with <strong>OmniAuth</strong>. After reading migration guide I've added also omniauth-facebook gem and configured it in devise.rb.</p>
  
  <p>Now I'm getting this error:</p>
  
  <blockquote>
    <p>ActionView::Template::Error (undefined method
    `user_omniauth_authorize_path' for
     #&lt;#:0x00000003b01e88>)</p>
  </blockquote>
  
  <p>I was using this path for the Facebook login button. What should I use now?</p>
  
  <p>User model contains this (user.rb):</p>
  
  <pre><code> # Include default devise modules. Others available are:
    # :token_authenticatable, :confirmable, :lockable and :timeoutable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable,
           :omniauthable
  </code></pre>
  
  <p>Full server log:</p>
  
  <pre><code>Started GET "/" for 127.0.0.1 at 2012-02-22 10:39:27 +0200
  Processing by PagesController#guardian as HTML
  [paperclip] Duplicate URL for photo with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Asset class
    Rendered pages/guardian.html.erb within layouts/application (955.6ms)
  Completed 500 Internal Server Error in 1245ms
  
  ActionView::Template::Error (undefined method `user_omniauth_authorize_path' for #&lt;#&lt;Class:0x00000003b213f0&gt;:0x00000003b01e88&gt;):
      30:     &lt;/p&gt;
      31:             &lt;/td&gt;
      32:             &lt;td&gt;
      33:             &lt;%= link_to "Login with Facebook", user_omniauth_authorize_path(:facebook), :class =&gt; "login_with_facebook_button" %&gt;
      34:             &lt;/td&gt;
      35:         &lt;/tr&gt;
      36:     &lt;/table&gt;
        app/views/pages/guardian.html.erb:33:in `_app_views_pages_guardian_html_erb___1979224720320394612_27892940'
  </code></pre>
  
  <p>Update: Ok, I managed to get resolved this path issue. Now when clicking on Facebook login button, I'm getting this:</p>
  
  <pre><code>Started GET "/users/auth/facebook" for 127.0.0.1 at 2012-02-23 16:02:01 +0200
  
  NoMethodError (undefined method `include?' for nil:NilClass):
    omniauth (1.0.2) lib/omniauth/strategy.rb:165:in `call!'
    omniauth (1.0.2) lib/omniauth/strategy.rb:148:in `call'
    warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
    warden (1.1.1) lib/warden/manager.rb:34:in `catch'
    warden (1.1.1) lib/warden/manager.rb:34:in `call'
  </code></pre>
  
  <p>This all is a bit confusing. The path problem resolved after I specified the :facebook params accodring to this tutorial: <a href="https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview" rel="noreferrer">https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview</a>. Now I also noticed that I'm missing omniauth.rb from config/initializers folder, which is mentioned in the omniauth-facebook wiki. I've created omniauth.rb with the following content, but still getting the same problem:</p>
  
  <pre><code>Rails.application.config.middleware.use OmniAuth::Builder do
      provider :facebook, ENV['APP_ID'], ENV['APP_SECRET']
    end
  </code></pre>