image model
class Image < ActiveRecord::Base
has_attachment
end
mailman controller
class Mailman < ActionMailer::Base
def receive(email)
email.attachments.each do |attachment|
Image.create :uploaded_data => attachment
end
end
end
I got returned email with error messages
Command died with status 1: “/usr/local/bin/ruby
/home/email_test/script/runner ‘Mailman.receive(STDIN.read)’”. =
Command
output:
=
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/runner.rb:47:
/usr/local/lib/ruby/1.8/tempfile.rb:46:in initialize': cannot = generate tempfile =
/home/email_test/script/…/config/…/tmp/attachment_fu/11862540901020801=
593_f62fd725ce18176-9.jpg’
(RuntimeError) from
=
/home/email_test/script/…/config/…/vendor/plugins/attachment_fu/lib/tec=
hnoweenie/attachment_fu.rb:170:in
new' from = /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/tec= hnoweenie/attachment_fu.rb:170:in
write_to_temp_file’ from
=
/home/email_test/script/…/config/…/vendor/plugins/attachment_fu/lib/tec=
hnoweenie/attachment_fu.rb:304:in
write_to_temp_file' from = /home/email_test/script/../config/../vendor/plugins/attachment_fu/lib/tec= hnoweenie/attachment_fu.rb:294:in
temp_data=3D’ from
=
/home/email_test/script/…/config/…/vendor/plugins/attachment_fu/lib/tec=
hnoweenie/attachment_fu.rb:259:in
uploaded_data=3D' from = /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/b= ase.rb:1672:in
send’ from
=
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/b=
ase.rb:1672:in
attributes=3D' from = /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/b= ase.rb:1671:in
each’ … 11 levels… from
=
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/runner.rb:47
from =
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’ from /home/email_test/script/runner:3