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
On Oct 17, 4:07 pm, ebrad
<nisguy_...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:> 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
>
> <------>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---