2010-10-10 15 views
5

मैं निम्न त्रुटि हो रही है: रूबी 1.8.7 के साथरेल 3 Authlogic - 'acts_as_authentic' अपरिभाषित

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' 

मैं रेल 3.0.0 का उपयोग कर रहा हूँ,।

class User < ActiveRecord::Base 
    acts_as_authentic 
end 

मैं चाहे के माध्यम से या सर्वर के माध्यम से 'रेल सांत्वना' एक ही त्रुटि मिलती है:

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

मेरी User.rb फ़ाइल की संपूर्ण सामग्री इस प्रकार हैं: इस प्रकार Authlogic मेरी Gemfile में है । मैंने गिनती से अधिक बार सर्वर को पुनरारंभ किया है। कृपया मदद करें, मैं इसे समझ नहीं सकता।

उत्तर

0

क्या एथलॉगिक जेम स्थापित है?

कृपया

Bundle install

यह आपकी समस्या का समाधान करना चाहिए।

+0

कोशिश यह स्थापित किया गया है। यह मुद्दा नहीं है – Chris

1

रेल 3

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

या और भी बेहतर के लिए समझौता authlogic के एक संस्करण का उपयोग करें। उपयोग वसीयत

0
gem "authlogic", "2.1.6" 

फिर

Bundle install 

आशा है कि यह आप के लिए में सहायक होगा। :)

0

restful_authentication.rb रूप config/initializers में एक फ़ाइल बनाने और फ़ाइल और पुन: प्रारंभ सर्वर के अंदर इस पेस्ट और

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' 
संबंधित मुद्दे