Application doesn't work on two different machines

Hello,

I've got an application which I am developing on a Windows machine and everything works just fine. Once I upload it on my server (Debian) and test it I get following error: ActionView::TemplateError (undefined local variable or method `filename' for #<News:0x41105540>) on line #8 of news/index.html.erb: 5: </tr> 6: <tr> 7: <td class="news_table_pic"> 8: <%= image_tag(news.public_filename) %><br> 9: Erstellt am <%= news.created_at.strftime("%d.%m.%Y") %><br> 10: von <%=h news.author %> 11: </td>

I'm using attachment_fu.

Anyone knows why it doesn't work on my debian machine?

Thanks

It looks like you are using a plugin such as attachment_fu. Ensure that you have that included in your deployment to production.

Cheers, Nicholas

1. I wouldn't have thought the RMagick version would have mattered, can you confirm the attachment_fu is being deploy to your production environment?

2. Perhaps try upgrading imagemagick first before installing rmagick.

Cheers, Nicholas

Putting aside the RMagick issue (can't really help you there), do you have the full error trace for:

ActionView::TemplateError (undefined local variable or method `filename' for #<News:0x41105540>) on line #8 of news/index.html.erb:

Which version of rails are you developing with locally?

Local Windows machine: Rails 2.2.2 ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] gem 1.3.2

Debian machine (not working on this machine): Rails 2.2.2 ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux] gem 1.3.1

I think in your production environment you are using an older version of Rails (review your error trace):

/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/

You should vendor your rails with your application to avoid this in the future.

Looks like it's an incompatibility with the version of attachment_fu and active-record/rails.

Cheers, Nicholas

Have you tried updating attribute_fu? Where did you source it from?

I meant attachment_fu

I just updated attachment_fu and did a db:migrate:reset and now everything works like a charm :slight_smile: Thank you!

OK, could have been a version conflict between Rails and attachment-fu. One thing I didn't think of asking was to ensure you had run the migrations in production. Pleased to hear you are good to go.

Cheers, Nicholas