title: rails undefined method `attr_accessible'
body: <p>I'm trying to add an authentication system into my app and I've run into this error when I run "rake db:migrate":</p>
  
  <pre><code>NoMethodError: undefined method `attr_accessible' for User (call 'User.connection' to establish a connection):Class
  /Users/liferaymac/Desktop/check/app/models/user.rb:8:in `&lt;class:User&gt;'
  /Users/liferaymac/Desktop/check/app/models/user.rb:1:in `&lt;top (required)&gt;'
  /Users/liferaymac/Desktop/check/config/routes.rb:2:in `block in &lt;top (required)&gt;'
  /Users/liferaymac/Desktop/check/config/routes.rb:1:in `&lt;top (required)&gt;'
  /Users/liferaymac/Desktop/check/config/environment.rb:5:in `&lt;top (required)&gt;'
  Tasks: TOP =&gt; db:migrate =&gt; environment
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>Here is a view of my user.rb file, which is my model:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable, :validatable
  
    # Setup accessible (or protected) attributes for your model
    attr_accessible :email, :password, :password_confirmation
  end
  </code></pre>
  
  <p>And here is my migrate file:</p>
  
  <pre><code>class DeviseCreateUsers &lt; ActiveRecord::Migration
    def self.up
      create_table(:users) do |t|
        t.database_authenticatable :null =&gt; false
        # t.confirmable
        t.recoverable
        t.rememberable
        t.trackable
        # t.lockable :lock_strategy =&gt; :failed_attempts, :unlock_strategy =&gt; :both
  
        t.timestamps
      end
  
      add_index :users, :email,                :unique =&gt; true
      # add_index :users, :confirmation_token,   :unique =&gt; true
      add_index :users, :reset_password_token, :unique =&gt; true
      # add_index :users, :unlock_token,         :unique =&gt; true
    end
  
    def self.down
      drop_table :users
    end
  end
  
  # migration
  create_table(:users) do |t|
    t.database_authenticatable :null =&gt; false
    # t.confirmable
    t.recoverable
    t.rememberable
    t.trackable
    # t.lockable :lock_strategy =&gt; :failed_attempts, :unlock_strategy =&gt; :both
  
    t.timestamps
  end
  
  add_index :users, :email,                :unique =&gt; true
  # add_index :users, :confirmation_token,   :unique =&gt; true
  add_index :users, :reset_password_token, :unique =&gt; true
  # add_index :users, :unlock_token,         :unique =&gt; true
  </code></pre>
  
  <p>I'm working from <a href="http://railscasts.com/episodes/209-introducing-devise?autoplay=true" rel="noreferrer">http://railscasts.com/episodes/209-introducing-devise?autoplay=true</a>
  I also ran bundle install and installed the devise gem already.
  Any insight will be greatly appreciated. </p>