Chris
Chris

Reputation: 51

Rails 3 Authlogic - 'acts_as_authentic' undefined

I'm getting the following error:

NameError (undefined local variable or method `acts_as_authentic' for #<Class:0x1037e6310>):
  app/models/user.rb:2
  app/controllers/user_controller.rb:3:in `new'

I'm using Rails 3.0.0, with Ruby 1.8.7. Authlogic is in my Gemfile as follows:

gem 'authlogic', :git => "git://github.com/binarylogic/authlogic.git"

The entire contents of my User.rb file are as follows:

class User < ActiveRecord::Base
   acts_as_authentic 
end

I get the same error whether through 'rails console' or through the server. I have restarted the server more times than I can count. Please help, I can't figure it out.

Upvotes: 5

Views: 2131

Answers (4)

Remya Senan
Remya Senan

Reputation: 1

create a file in config/initializers as restful_authentication.rb and paste this inside the file and restart server and try

require 'authenticated_system'
require 'restful_authentication/authentication'
require 'restful_authentication/authentication/by_password'
require 'restful_authentication/authentication/by_cookie_token'
require 'restful_authentication/authorization/aasm_roles'
require 'restful_authentication/authorization/stateful_roles'
require 'restful_authentication/trustification/email_validation'

Upvotes: 0

khanh
khanh

Reputation: 4606

gem "authlogic",   "2.1.6"

Then

Bundle install

Hope it'll helpfull for you. :)

Upvotes: 0

glebm
glebm

Reputation: 21090

Use a version of authlogic patched for Rails 3

gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'

Or even better. Use Devise

Upvotes: 1

Rishav Rastogi
Rishav Rastogi

Reputation: 15482

Is the Authlogic Gem installed ?.

Please do

Bundle install

this should solve your problem.

Upvotes: 0

Related Questions