Issues with rails_authentication --include-activation

Hello,

So I installed the restful_authenticaiton plugin on an empty rails
2.3.4 project.

$ script/plugin install restful_authentication

Generated files using “Students” as my model (instead of the often-
used “Users”). Note that I’ve added the --include-activation flag.

$ ./script/generate authenticated students sessions --include-
activation

And after editing my environment.rb with the line:
config.active_record.observers = :student_observer # or whatever you

I get the following output when trying to run script/server

$ ./script/server => Booting WEBrick => Rails 2.3.4 application
starting on http://0.0.0.0:3000 /Library/Ruby/Gems/1.8/gems/
activesupport-2.3.4/lib/active_support/dependencies.rb:443:in
load_missing_constant’: uninitialized constant StudentObserver
(NameError)

from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/dependencies.rb:80:in const_missing' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:92:inconst_missing’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/inflector.rb:361:in constantize' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/inflector.rb:360:ineach’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/inflector.rb:360:in constantize' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/core_ext/string/inflections.rb:162:inconstantize’
from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
observer.rb:38:in instantiate_observers' from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/ observer.rb:36:ineach’
from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
observer.rb:36:in instantiate_observers' from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/ action_controller/dispatcher.rb:15:indefine_dispatcher_callbacks’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/callbacks.rb:182:in call' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/callbacks.rb:182:inevaluate_method’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/callbacks.rb:166:in call' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/callbacks.rb:90:inrun’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/callbacks.rb:90:in each' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/callbacks.rb:90:insend’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/callbacks.rb:90:in run' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/callbacks.rb:276:inrun_callbacks’
from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/
action_controller/dispatcher.rb:51:in send' from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.4/lib/ action_controller/dispatcher.rb:51:inrun_prepare_callbacks’
from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:631:in
prepare_dispatcher' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:185:inprocess’
from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
send' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:inrun’
from /Users/aarz/Sites/50forthefuture/branches/heroku3/config/
environment.rb:9
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/dependencies.rb:156:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:521:innew_constants_in’
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/
active_support/dependencies.rb:156:in require' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’
from ./script/server:3

What step might I have missed to get this error?

salamander wrote:

Hello,

So I installed the restful_authenticaiton plugin on an empty rails
2.3.4 project.

$ script/plugin install restful_authentication

[…]

This doesn’t directly address your problem, but I’d suggest that you
forget about restful_authentication and use Authlogic instead. It won’t
fill your model files with framework-generated crap, and it’s a lot
nicer to work with.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

If you specify :student_observer your “script/generate” should be:

script/generate authenticated student sessions --include-activation

NOTE: student not students