SystemExit (exit): attachment_fu 500 error

In production mode, my app is returning a 500 error having to do with
attachment_fu in my comments model. Here is my original model that
worked in development mode:

<---- Original Comment Model (not working) ------------------>

class ApplicantComment < ActiveRecord::Base
belongs_to :applicant

has_attachment :storage => :file_system, :path_prefix => “public/
file_attachments/”

def partitioned_path(*args)
("%04d" % applicant_id).scan(/…/) + args
end
end
<------->

The reason I know it’s because of attachment_fu is because the only
way I can get the page to load is by stripping out everything except
the ‘belongs_to’, like this:

<---- Modified Comment Model with Attachment (works) ------------------

class ApplicantComment < ActiveRecord::Base
belongs_to :applicant
end
<------->

Here’s my log. Could it have to do with ImageScience even though the
files are not images?

<---- Production log error ------------------>

Processing ApplicantsController#edit (for mysite at 2007-10-17
14:51:16) [GET]
Session ID: 808ff07ac9f8d9414fb566d4ffb7239b
Parameters: {“action”=>“edit”, “id”=>“20”,
“controller”=>“applicants”}

SystemExit (exit):
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb:
70:in exit' /usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb: 70:inrootdir’
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb:
84:in directory' /usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb: 258:inso_name’
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb:
294:in load_cache' /usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.4/lib/inline.rb: 675:ininline’
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.3/lib/
image_science.rb:84
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:495:in require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:342:innew_constants_in’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:495:in require' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/ processors/image_science_processor.rb:1 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:203:inload_without_new_constant_marking’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:203:in load_file' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:342:innew_constants_in’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:202:in load_file' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:94:inrequire_or_load’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:248:in load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:452:inconst_missing’
/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:
85:in const_get' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb: 85:inhas_attachment’
/app/models/applicant_comment.rb:4
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:203:in
load_without_new_constant_marking' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:203:inload_file’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:342:in new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:202:inload_file’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:94:in require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:248:inload_missing_constant’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:452:in const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:464:inconst_missing’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/base.rb:1358:in compute_type' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/reflection.rb:125:insend’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/reflection.rb:125:in klass' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations/has_many_association.rb:194:inconstruct_sql’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/associations/has_many_association.rb:6:in initialize' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations.rb:934:innew’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/associations.rb:934:in applicant_comments' /app/controllers/applicants_controller.rb:30:inedit’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/base.rb:1095:in send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:1095:inperform_action_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/filters.rb:632:in call_filter' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/filters.rb:619:inperform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/rescue.rb:83:inperform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/base.rb:430:in send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:430:inprocess_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/filters.rb:624:in
process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/session_management.rb:114:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/base.rb:330:in process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb: 41:indispatch’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:
168:in process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb: 143:inprocess_each_request!’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:
109:in with_signal_handler' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb: 142:inprocess_each_request!’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in
each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:ineach’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb: 141:inprocess_each_request!’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:
55:in process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb: 25:inprocess!’
dispatch.fcgi:24

<------>

UPDATE:

It turned out to be a problem with the server’s installation of Image
science. I did not have the image processor defined, so it was
wanting to use Image Science. The server has Rmagick, so I updated my
model:

class ApplicantComment < ActiveRecord::Base
belongs_to :applicant

has_attachment :content_type => :image,
:processor => :Rmagick,
:storage => :file_system,
:path_prefix => “public/file_attachments/”

def partitioned_path(*args)
("%04d" % applicant_id).scan(/…/) + args
end
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs