# Session / name error

**URL:** <https://www.ruby-forum.com/t/session-name-error/115952>\
**Category:** Rails\
**Created:** [September 30, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/session-name-error/115952 "2007-09-30T22:54:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/b2d939/32.png) [@fero](https://www.ruby-forum.com/u/fero)\
**Post date:** [September 30, 2007, 10:54pm UTC](https://www.ruby-forum.com/t/session-name-error/115952/1 "2007-09-30T22:54:05Z")

</div>

Hi folks.

I am storing some objects in session. Those classes are defined in  
/lib/graphalg.rb. So I am requiring it automaticaly. But when computing  
next request, following error is occured:

Session contains objects whose class definition isn’t available.  
Remember to require the classes for all objects kept in the session.  
(Original exception: wrong constant name GraphAlg:: [NameError])

I’ve tried to add require ‘GraphAlg’ to enviroment.rb, (of course)  
doesn’t matter.

Please help (and receive beer in Prague).

Thanks, F.

---

<div class="post-metadata">

**Author:** ![fero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/b2d939/32.png) [@fero](https://www.ruby-forum.com/u/fero)\
**Post date:** [October 1, 2007, 11:08am UTC](https://www.ruby-forum.com/t/session-name-error/115952/2 "2007-10-01T11:08:50Z")

</div>

On 30 Sep 2007, at 21:54, Frantisek P. wrote:

> Hi folks.
> 
> I am storing some objects in session. Those classes are defined in  
> /lib/graphalg.rb. So I am requiring it automaticaly. But when  
> computing  
> next request, following error is occured:

[usual warning about it being naughty to put objects in the session]

> Session contains objects whose class definition isn’t available.  
> Remember to require the classes for all objects kept in the session.  
> (Original exception: wrong constant name GraphAlg:: [NameError])
> 
> I’ve tried to add require ‘GraphAlg’ to enviroment.rb, (of course)  
> doesn’t matter.

Unless that’s a typo, require ‘graphalg’ is what you should be typing.

Fred
