# ActionView::TemplateError

**URL:** <https://www.ruby-forum.com/t/actionview-templateerror/105449>\
**Category:** Rails\
**Created:** [May 30, 2007, 2:24am UTC](https://www.ruby-forum.com/t/actionview-templateerror/105449 "2007-05-30T02:24:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://www.ruby-forum.com/u/johnny)\
**Post date:** [May 30, 2007, 2:24am UTC](https://www.ruby-forum.com/t/actionview-templateerror/105449/1 "2007-05-30T02:24:04Z")

</div>

Hi,

I have a strange problem that only occurs on the production server.  
I’ve been banging my head for hours trying to figure it out with no  
success. Below is a copy of the error from the production log.

ActionView::TemplateError (Expected /www/rails\_apps/scanlan/current/  
public/…/config/…/app/models/image.rb to define Image) on line #6 of  
app/views/admin/design/\_record.rhtml:  
3:

\<%= link\_to record.comments, :action =\> ‘edit’, :id =\> record  
%\>  
4:   
5:  
6: \<%= link\_to “View Images (#{record.images.size.to\_s})”,  
{:controller =\> ‘design’, :action =\> ‘workspace’, :design\_id =\>  
record} %\>  
7:  
8:   
9: 

```
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/

```

dependencies.rb:249:in `load_missing_constant' #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/ dependencies.rb:452:in`const\_missing’  
#{RAILS\_ROOT}/vendor/rails/activesupport/lib/active\_support/  
dependencies.rb:464:in `const_missing' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb: 1386:in`compute\_type’  
#{RAILS\_ROOT}/vendor/rails/activerecord/lib/active\_record/  
reflection.rb:125:in `send' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ reflection.rb:125:in`klass’  
#{RAILS\_ROOT}/vendor/rails/activerecord/lib/active\_record/  
associations/has\_many\_association.rb:174:in `construct_sql' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ associations/has_many_association.rb:6:in`initialize’  
#{RAILS\_ROOT}/vendor/rails/activerecord/lib/active\_record/  
associations.rb:998:in `new' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ associations.rb:998:in`images’  
#{RAILS\_ROOT}/app/views/admin/design/\_record.rhtml:6:in  
`_run_rhtml_47app47views47admin47design47_record46rhtml' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 328:in`send’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:  
328:in `compile_and_render_template' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 303:in`render\_template\_old’  
#{RAILS\_ROOT}/vendor/plugins/haml/lib/haml/template.rb:121:in  
`render_template' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 263:in`render\_file’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:  
278:in `render_without_haml' #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ action_view_mods.rb:17:in`render’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/partials.rb:  
60:in `render_partial' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ benchmarking.rb:30:in`benchmark’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/partials.rb:  
59:in `render_partial' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 289:in`render\_without\_haml’  
#{RAILS\_ROOT}/vendor/plugins/haml/lib/haml/helpers/  
action\_view\_mods.rb:17:in `render' #{RAILS_ROOT}/app/views/admin/design/list.rhtml:21:in`\_run\_rhtml\_47app47views47admin47design47list46rhtml’  
#{RAILS\_ROOT}/app/views/admin/design/list.rhtml:20:in `each' #{RAILS_ROOT}/app/views/admin/design/list.rhtml:20:in`\_run\_rhtml\_47app47views47admin47design47list46rhtml’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:  
328:in `send' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 328:in`compile\_and\_render\_template’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:  
303:in `render_template_old' #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:121:in`render\_template’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_view/base.rb:  
263:in `render_file' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ base.rb:855:in`render\_file’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
base.rb:760:in `render_with_no_layout' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ layout.rb:250:in`render\_without\_benchmark’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
benchmarking.rb:51:in `render' /usr/lib/ruby/1.8/benchmark.rb:293:in`measure’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
benchmarking.rb:51:in `render' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ base.rb:1121:in`perform\_action\_without\_filters’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:623:in `call_filter' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:625:in`call\_filter’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:629:in `call_filter' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:438:in`call’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:628:in `call_filter' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:625:in`call\_filter’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:629:in `call_filter' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:438:in`call’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:628:in `call_filter' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:629:in`call\_filter’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:438:in `call' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ filters.rb:628:in`call\_filter’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:657:in `perform_action_without_benchmark' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ benchmarking.rb:68:in`perform\_action\_without\_rescue’  
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ benchmarking.rb:68:in`perform\_action\_without\_rescue’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
rescue.rb:125:in `perform_action_without_caching' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ caching.rb:625:in`perform\_action’  
#{RAILS\_ROOT}/vendor/rails/activerecord/lib/active\_record/  
query\_cache.rb:99:in `cache' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ caching.rb:624:in`perform\_action’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
base.rb:473:in `send' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ base.rb:473:in`process\_without\_filters’  
#{RAILS\_ROOT}/vendor/rails/actionpack/lib/action\_controller/  
filters.rb:652:in `process_without_session_management_support' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ session_management.rb:122:in`sass\_old\_process’  
#{RAILS\_ROOT}/vendor/plugins/haml/lib/sass/plugin.rb:116:in  
`process' #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ base.rb:326:in`process’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/dispatcher.rb:39:in  
`dispatch' #{RAILS_ROOT}/vendor/rails/railties/lib/fcgi_handler.rb:168:in`process\_request’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/fcgi\_handler.rb:143:in  
`process_each_request!' #{RAILS_ROOT}/vendor/rails/railties/lib/fcgi_handler.rb:109:in`with\_signal\_handler’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/fcgi\_handler.rb:142:in  
`process_each_request!' /usr/local/lib/site_ruby/1.8/fcgi.rb:600:in`each\_cgi’  
/usr/local/lib/site\_ruby/1.8/fcgi.rb:597:in `each' /usr/local/lib/site_ruby/1.8/fcgi.rb:597:in`each\_cgi’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/fcgi\_handler.rb:141:in  
`process_each_request!' #{RAILS_ROOT}/vendor/rails/railties/lib/fcgi_handler.rb:55:in`process!’  
#{RAILS\_ROOT}/vendor/rails/railties/lib/fcgi\_handler.rb:25:in  
`process!’  
/www/rails\_apps/scanlan/current/public/dispatch.fcgi:24

Rendering /www/rails\_apps/scanlan/current/public/…/config/…/public/  
500.html (500 Internal Server Error)

Image.rb does define the Image model and when running script/server on  
my local box it works no problems at all. Feedback is greatly  
appreciated.

Thanks in advance,  
Johnny.

---

<div class="post-metadata">

**Author:** ![johnny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://www.ruby-forum.com/u/johnny)\
**Post date:** [June 20, 2007, 7:33am UTC](https://www.ruby-forum.com/t/actionview-templateerror/105449/2 "2007-06-20T07:33:31Z")

</div>

I still havn’t solved this ☹

Any help greatly appreciated!

---

<div class="post-metadata">

**Author:** ![johnny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://www.ruby-forum.com/u/johnny)\
**Post date:** [June 20, 2007, 4:18pm UTC](https://www.ruby-forum.com/t/actionview-templateerror/105449/3 "2007-06-20T16:18:50Z")

</div>

The file needs to be app/models/image.rb (note the lowercase name)  
and define the class Image (capitalized class name constant).

If your local server’s filesystem is case-insensitive, app/models/  
Image.rb and app/models/image.rb are effectively the same as APP/  
mOdEls/iMAge.Rb. I suspect that your production server isn’t so  
lenient with filenames.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
