# Changes to Class File Not Being Recognized by Webrick

**URL:** <https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163>\
**Category:** Rails\
**Created:** [February 24, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163 "2006-02-24T21:12:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 24, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/1 "2006-02-24T21:12:23Z")

</div>

Newbie, having good luck with Dave T.’ book ‘Depot’ application  
until I discovered that changes to one of my .rb class files are not  
being recognized until I bounce the webrick server.

Any ideas on this? Thanks.

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 24, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/2 "2006-02-24T21:18:08Z")

</div>

running in prodcution mode??

.rb placed in lib??

if thats the case, you WILL need to restart webrick…otherwise NOT…

On Friday, February 24, 2006, at 9:12 PM, Gaudi wrote:

> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Mikkel B.

www.strongside.dk - Football Portal(DK)  
[nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
ting.minline.dk - Buy Old Stuff!(DK)

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 24, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/3 "2006-02-24T21:37:00Z")

</div>

I believe I’m running in development mode (how do I know which mode I’m  
running in?) because in database.yml the “test” and “production”  
databases do not exist.

Are you saying that the .rb file(s) should be in the lib directory? The  
Thomas book is telling me to put them in app/models directory.

app environment:  
Ruby version 1.8.2 (powerpc-darwin8.0)  
RubyGems version 0.8.10  
Rails version 1.0.0  
Active Record version 1.13.2  
Action Pack version 1.11.2  
Action Web Service version 1.0.0  
Action Mailer version 1.1.5  
Active Support version 1.2.5  
Application root /usr/local/rails/depot  
Environment development  
Database adapter mysql

Thanks,  
David

Mikkel B. wrote:

> running in prodcution mode??
> 
> .rb placed in lib??
> 
> if thats the case, you WILL need to restart webrick…otherwise NOT…
> 
> On Friday, February 24, 2006, at 9:12 PM, Gaudi wrote:
> 
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> Mikkel B.
> 
> www.strongside.dk - Football Portal(DK)  
> [nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
> ting.minline.dk - Buy Old Stuff!(DK)

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 24, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/4 "2006-02-24T22:09:42Z")

</div>

Models need to be placed in app/models…

If you havent done anything actively, you should be in development  
mode…

I havent havent heard of this problem before…is it just plain and  
simple ruby objects?? are you storing them in session??

On Friday, February 24, 2006, at 9:37 PM, Gaudi wrote:

> Rails version 1.0.0  
> David
> 
> > > removed\_email\_address@domain.invalid  
> > > –  
> > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Mikkel B.

www.strongside.dk - Football Portal(DK)  
[nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
ting.minline.dk - Buy Old Stuff!(DK)

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 25, 2006, 2:08am UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/5 "2006-02-25T02:08:46Z")

</div>

If you are looking to change your envrionment from production to  
development, it is actually quite easy. Since Rails knows to look at the  
RAILS\_ENV environament variable, you can change that in  
config/environement.rb to development and that might fix your server  
re-starting issue.

HTH,  
Ryan

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 25, 2006, 10:32am UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/6 "2006-02-25T10:32:32Z")

</div>

Gaudi

```
   > I believe I'm running in development mode (how do I know which

```

mode I’m  
\> running in?)

In your view add:

```
mode: <%= ENV['RAILS_ENV'] %>
```

---

<div class="post-metadata">

**Author:** ![Gaudi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gaudi](https://www.ruby-forum.com/u/Gaudi)\
**Post date:** [February 24, 2006, 11:13pm UTC](https://www.ruby-forum.com/t/changes-to-class-file-not-being-recognized-by-webrick/54163/7 "2006-02-24T23:13:21Z")

</div>

Yes, my cart.rb object is a shopping cart, stored in the session.

I would think that if I deleted my cookie, which I’m doing, then changes  
to cart.rb would then appear because Ruby would create a new session  
object, right? But that’s not happening. Only restarting webrick  
forces Rails to see changes to my cart.rb

I’ve tried

session[:cart] = nil

which does remove the cart from the session, but it does NOT force Rails  
to re-read the cart.rb class file.

Oh well, I guess I’ll just bounce the server. I am surprised that no  
one else is talking about this online.

Thanks for your assistance Mikkel.

Mikkel B. wrote:

> Models need to be placed in app/models…
> 
> If you havent done anything actively, you should be in development  
> mode…
> 
> I havent havent heard of this problem before…is it just plain and  
> simple ruby objects?? are you storing them in session??
> 
> On Friday, February 24, 2006, at 9:37 PM, Gaudi wrote:
> 
> > Rails version 1.0.0  
> > David
> > 
> > > > removed\_email\_address@domain.invalid  
> > > > –  
> > > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> Mikkel B.
> 
> www.strongside.dk - Football Portal(DK)  
> [nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
> ting.minline.dk - Buy Old Stuff!(DK)
