# Missing constant

**URL:** <https://www.ruby-forum.com/t/missing-constant/128291>\
**Category:** Rails\
**Created:** [February 6, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/missing-constant/128291 "2008-02-06T13:26:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sotirac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@sotirac](https://www.ruby-forum.com/u/sotirac)\
**Post date:** [February 6, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/missing-constant/128291/1 "2008-02-06T13:26:26Z")

</div>

The problem says that spec.rb to define Spec. The file exist but and  
it includes the constant. The thing that is weird is that the problem  
occurs only during my production environment. IN my development  
environment, i dont get these errors. has anybody encountered this  
problem.

* * *

The error found in production.log:

ActionView::TemplateError (Expected /var/www/apps/nomadzone/releases/  
20080206115530/app/models/spec.rb to define Spec) on line #24 of  
community/\_browse\_form.rhtml:  
21: Within  
22: \<%= text\_field\_tag “miles”, params[:miles], :size =\> 4 %\>  
23: miles from zip code:  
24: \<%= text\_field\_tag “zip\_code”, params[:zip\_code], :size =\>  
Spec::ZIP\_CODE\_LENGTH %\>  
25:   
26: \<%= submit\_tag “Browse”, :class =\> “submit” %\>  
27:

```
vendor/rails/activesupport/lib/active_support/dependencies.rb:

```

249:in `load\_missing\_constant’

* * *

This is my spec.rb file:

class Spec \< ActiveRecord::Base

belongs\_to :user  
acts\_as\_ferret

ZIP\_CODE\_LENGTH = 5  
ALL\_FIELDS = %w(first\_name last\_name occupation gender birthdate  
city state zip\_code)  
STRING\_FIELDS = %w(first\_name last\_name occupation city state)  
VALID\_GENDERS = [“Male”, “Female”]  
START\_YEAR = 1900  
VALID\_DATES = DateTime.new(START\_YEAR)…DateTime.now
