Hi there,
I’m running a themed rails app and have just switched to mongrel which I
have running proxied from apache2 on ubuntu.
I have the app up and running and it works both via apache and calling
the mongrel port direct, but I have a problem from within the theme when
running a validation check on images controlled by filecolumn.
I have file column images in:
/public/images/artwork/…
theme template in:
/themes/name/views/artworks/show.rhtml
with in the template I have:
<% for @image in @artwork.images.select{ |img| img.valid?() and img !=
@artwork.preview_image } -%>
which gives me (briefly - stack trace below):
ActionView::TemplateError (No such file or directory -
images/artwork/78/lying_in_newspapers.jpg) on line #60 of
themes/hayleynewman/views/artworks/show.rhtml:
I assume it’s now looking the theme root rather than rails public root,
but I have no idea how to deal with it.
This worked fine until I switched to mongrel. Does anyone know of
something I need to tell mongrel to stop this happening?
thanks
dorian
Stack:
ActionView::TemplateError (No such file or directory -
images/artwork/78/lying_in_newspapers.jpg) on line #60 of
themes/hayleynewman/views/artworks/show.rhtml:
57:
58: <% if @artwork.images.length > 1 %>
All Images:
<% end -%>59:
60: <% for @image in @artwork.images.select{ |img| img.valid?() and img
!= @artwork.preview_image } -%>
61: <%= render :partial => “/images/artwork_image” -%>
62: <% end -%>
63: <% @image = @artwork.preview_image %>
#{RAILS_ROOT}/vendor/plugins/file_column/lib/validations.rb:65:in
size' #{RAILS_ROOT}/vendor/plugins/file_column/lib/validations.rb:65:in
validates_filesize_of’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:302:in
validates_each' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:299:in
validates_each’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:794:in
run_validations' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:788:in
run_validations’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:752:in
valid_without_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/callbacks.rb:306:in
valid?’
#{RAILS_ROOT}/themes/hayleynewman/views/artworks/show.rhtml:60:in
_run_rhtml__home_dorian_www_hayleynewman46com_themes_hayleynewman_views_artworks_show' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/associations/association_proxy.rb:110:in
method_missing’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/associations/has_many_association.rb:90:in
method_missing' #{RAILS_ROOT}/themes/hayleynewman/views/artworks/show.rhtml:60:in
_run_rhtml__home_dorian_www_hayleynewman46com_themes_hayleynewman_views_artworks_show’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/base.rb:314:in
compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/base.rb:290:in
render_template’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/base.rb:249:in
__render_file' #{RAILS_ROOT}/vendor/plugins/theme_support/lib/patches/actionview_ex.rb:43:in
render_file’
#{RAILS_ROOT}/vendor/plugins/theme_support/lib/patches/actionview_ex.rb:23:in
render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:699:in
render_file’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:621:in
render_with_no_layout' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/layout.rb:243:in
render_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:53:in
render' /usr/lib/ruby/1.8/benchmark.rb:293:in
measure’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:53:in
render' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:911:in
perform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/rescue.rb:82:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb:381:in
process_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:377:in
process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_management.rb:117:in
process’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in
dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in
process’
/usr/lib/ruby/1.8/sync.rb:229:in synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in
process’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
process_client’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in
run’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in
run’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in
`run’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231
/usr/bin/mongrel_rails:18
–
I do things for love or money