# Issues with rails\_authentication --include-activation

**URL:** <https://www.ruby-forum.com/t/issues-with-rails-authentication-include-activation/178656>\
**Category:** Rails\
**Created:** [November 9, 2009, 2:56am UTC](https://www.ruby-forum.com/t/issues-with-rails-authentication-include-activation/178656 "2009-11-09T02:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![salamander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@salamander](https://www.ruby-forum.com/u/salamander)\
**Post date:** [November 9, 2009, 2:56am UTC](https://www.ruby-forum.com/t/issues-with-rails-authentication-include-activation/178656/1 "2009-11-09T02:56:08Z")

</div>

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](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:in `const\_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:in `each’  
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:in `constantize’  
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:in `each’  
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:in `define\_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:in `evaluate\_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:in `run’  
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:in `send’  
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:in `run\_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:in `run\_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:in `process’  
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:in `run’  
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:in `require’  
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:in `new\_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:in `gem\_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?

---

<div class="post-metadata">

**Author:** ![salamander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@salamander](https://www.ruby-forum.com/u/salamander)\
**Post date:** [November 9, 2009, 6:18am UTC](https://www.ruby-forum.com/t/issues-with-rails-authentication-include-activation/178656/2 "2009-11-09T06:18:45Z")

</div>

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](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![salamander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@salamander](https://www.ruby-forum.com/u/salamander)\
**Post date:** [November 11, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/issues-with-rails-authentication-include-activation/178656/3 "2009-11-11T19:49:46Z")

</div>

If you specify :student\_observer your “script/generate” should be:

script/generate authenticated student sessions --include-activation

NOTE: student not students
