Forum: Italian Ruby user group Errore nella newsletter

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
55c0442cd5c32fd65785e8e1a9d759c2?d=identicon&s=25 Ale Dv (spitfire)
on 2008-10-30 11:11
Quando inserisco un articolo uso il metodo:

  def send_news_letter(article,email)
    recipients    email
    bcc           "info@cerasi.org"
    from          "info@cerasi.org"
    subject       article.notice.title
    body          :article => article, :url => url_for(:host =>
"www.nome-jost.org", :controller => :site, :action => :show_news, :id =>
article.id)
    attachment    :content_type => "image/jpeg", :body =>
File.read(RAILS_ROOT + "/public" + article.image.public_filename)
    content_type  "text/html"
  end

dopo l'invio di qualche e-mail va in errore:

ActiveRecord::Transactions::TransactionError (Transaction aborted):
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:76:in
`transaction'
    /usr/lib/ruby/1.8/net/protocol.rb:133:in `call'
    /usr/lib/ruby/1.8/net/protocol.rb:133:in `sysread'
    /usr/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill'
    /usr/lib/ruby/1.8/timeout.rb:56:in `timeout'
    /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
    /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
    /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
    /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
    /usr/lib/ruby/1.8/net/smtp.rb:664:in `recv_response'
    /usr/lib/ruby/1.8/net/smtp.rb:658:in `get_response'
    /usr/lib/ruby/1.8/net/smtp.rb:549:in `send0'
    /usr/lib/ruby/1.8/net/smtp.rb:686:in `critical'
    /usr/lib/ruby/1.8/net/smtp.rb:548:in `send0'
    /usr/lib/ruby/1.8/net/smtp.rb:472:in `sendmail'
    /usr/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:588:in
`perform_delivery_smtp'
    /usr/lib/ruby/1.8/net/smtp.rb:379:in `start'
    /usr/lib/ruby/1.8/net/smtp.rb:316:in `start'
    /usr/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:586:in
`perform_delivery_smtp'
    /usr/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in
`__send__'
    /usr/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in
`deliver!'
    /usr/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in
`method_missing'
    /app/models/article.rb:8
    /app/models/article.rb:7:in `each'
    /app/models/article.rb:7
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:311:in
`call'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:311:in
`callback'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:304:in
`each'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:304:in
`callback'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:227:in
`create_without_timestamps'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/timestamp.rb:29:in
`create'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2238:in
`create_or_update_without_callbacks'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:213:in
`create_or_update'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1972:in
`save_without_validation'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/validations.rb:934:in
`save_without_transactions'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in
`save'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in
`transaction'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in
`transaction'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in
`save'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:120:in
`rollback_active_record_state!'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in
`save'
    /app/controllers/admin/articles_controller.rb:25:in `create'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in
`send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in
`call_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in
`perform_action'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in
`cache'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in
`perform_action'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in
`send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in
`process_without_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in
`process'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in
`process'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in
`handle_request'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in
`process_request'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in
`with_signal_handler'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in
`process_request'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in
`process_each_request'
    /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
    /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
    /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in
`process_each_request'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in
`process!'
    /public/dispatch.fcgi:24
This topic is locked and can not be replied to.