# ActionView::TemplateError

**URL:** <https://www.ruby-forum.com/t/actionview-templateerror/142864>\
**Category:** Rails\
**Created:** [July 12, 2008, 10:03am UTC](https://www.ruby-forum.com/t/actionview-templateerror/142864 "2008-07-12T10:03:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ccd318/32.png) [@elle](https://www.ruby-forum.com/u/elle)\
**Post date:** [July 12, 2008, 10:03am UTC](https://www.ruby-forum.com/t/actionview-templateerror/142864/1 "2008-07-12T10:03:57Z")

</div>

Hi,

I’ve developed an application last year, deployed it to the web server  
and it worked great.  
Last week, there were some changes to the hosting plan (changing  
username mainly …) but for some reason I am experiencing problems  
with an application now (same application that worked before).

The application uses rails 1.2.3. The error that the production log  
has is:

ActionView::TemplateError (Expected …/config/…/app/models/product.rb  
to define Product) on line #19 of app/views/home/index.rhtml:  
16:

  
17: 
## Featured Products
  
18: 
  
19: \<% if Product.valid %\>  
20: \<% Product.featured.each do |f| %\>  
21: - \<%= link\_to f.title, :controller =\> “catalog”, :action  
=\>  
“show”, :id =\> f.id %\>
  
22: \<% end %\>

Would you know why suddenly it is giving me grief? and/or how to fix  
it?

TIA,  
Elle

---

<div class="post-metadata">

**Author:** ![elle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ccd318/32.png) [@elle](https://www.ruby-forum.com/u/elle)\
**Post date:** [July 13, 2008, 6:25am UTC](https://www.ruby-forum.com/t/actionview-templateerror/142864/2 "2008-07-13T06:25:27Z")

</div>

Ok, so on my local machine the site loads fine – no error messages.  
Same application on the web server (which worked fine beforehand) –  
does not.  
I do have SSH access but I am not sure how to get the console on the  
web server.

I will contact the web host as well. Any other suggestions as to what  
to look for?  
Thanks,  
Elle

On Jul 12, 8:34 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![elle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ccd318/32.png) [@elle](https://www.ruby-forum.com/u/elle)\
**Post date:** [July 12, 2008, 10:35am UTC](https://www.ruby-forum.com/t/actionview-templateerror/142864/3 "2008-07-12T10:35:01Z")

</div>

On 12 Jul 2008, at 09:03, elle wrote:

> ActionView::TemplateError (Expected …/config/…/app/models/product.rb  
> to define Product) on line #19 of app/views/home/index.rhtml:

That unhelpful message means “something went wrong loading product.rb”.  
If you ruby script/console and just type  
Product

You should get a better error message.

---

<div class="post-metadata">

**Author:** ![elle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ccd318/32.png) [@elle](https://www.ruby-forum.com/u/elle)\
**Post date:** [July 13, 2008, 7:04am UTC](https://www.ruby-forum.com/t/actionview-templateerror/142864/4 "2008-07-13T07:04:36Z")

</div>

Hi Elle,

After sshing into your server, you can access the console by doing the  
following:  
$ /path/to/your/app/script/console production

Note that you may need to change permissions on console to execute it.  
$ sudo chmod a+x /path/to/your/app/script/console

If you don’t find a more helpful error message, would you paste your  
product.rb file here?
