# SystemExit (exit): attachment\_fu 500 error

**URL:** <https://www.ruby-forum.com/t/systemexit-exit-attachment-fu-500-error/117542>\
**Category:** Rails\
**Created:** [October 17, 2007, 10:08pm UTC](https://www.ruby-forum.com/t/systemexit-exit-attachment-fu-500-error/117542 "2007-10-17T22:08:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@ebrad](https://www.ruby-forum.com/u/ebrad)\
**Post date:** [October 17, 2007, 10:08pm UTC](https://www.ruby-forum.com/t/systemexit-exit-attachment-fu-500-error/117542/1 "2007-10-17T22:08:48Z")

</div>

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:in`rootdir’  
/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:in`so\_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:in`inline’  
/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:in`require’  
/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:in`new\_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:in`load\_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:in`new\_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:in`require\_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:in`const\_missing’  
/vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:  
85:in `const_get' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb: 85:in`has\_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:in`load\_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:in`load\_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:in`load\_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:in`const\_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:in`send’  
/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:in`construct\_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:in`new’  
/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:in`edit’  
/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:in`perform\_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:in`perform\_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:in`measure’  
/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:in`perform\_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:in`process\_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:in`process’  
/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:in`dispatch’  
/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:in`process\_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:in`process\_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:in`each’  
/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:in`process\_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:in`process!’  
dispatch.fcgi:24

\<------\>

---

<div class="post-metadata">

**Author:** ![ebrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@ebrad](https://www.ruby-forum.com/u/ebrad)\
**Post date:** [October 23, 2007, 11:29am UTC](https://www.ruby-forum.com/t/systemexit-exit-attachment-fu-500-error/117542/2 "2007-10-23T11:29:53Z")

</div>

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
