Hi,
I''m getting this error:
Errno::ENOMEM in myController#print
cannot allocate memory
    app/controllers/fatture_controller.rb:205:in `system''
    app/controllers/fatture_controller.rb:205:in `print''
in this code (I''m using this way to directly print something on the
cups default printer.):
    205     if system(''/usr/bin/lpr'',
"fatture_pdf/fattura_#{intestazione.id}.pdf")
    206       render_text "Document printed"
    207     else
    208       render_text "Error."
    209     end
It happens sometimes when you print a lot of documents (calling a lot
of times the "print" action). I can''t replicate the error
right now
and I''m wondering a way to handle it.
someone have any suggestions?
Thanks,
Enrico
ps
this is coming from the development log:
Errno::ENOMEM (Cannot allocate memory):
    app/controllers/fatture_controller.rb:205:in `system''
    app/controllers/fatture_controller.rb:205:in `stampa''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:708:in
`send''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:708:in
`perform_action_without_filters''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/filters.rb:294:in
`perform_action_without_benchmark''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/benchmarking.rb:37:in
`perform_action_without_rescue''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/benchmarking.rb:37:in
`measure''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/benchmarking.rb:37:in
`perform_action_without_rescue''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/rescue.rb:79:in
`perform_action''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:330:in
`send''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:330:in
`process''
   
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/base.rb:273:in
`process''
    /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/dispatcher.rb:32:in
`dispatch''
    /opt/contabiliteoCartoplast/public/dispatch.rb:10
   
/usr/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in
`load''
   
/usr/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/dependencies.rb:189:in
`load''
    /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:82:in
`handle_dispatch''
    /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:35:in
`service''
    /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
    /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
    /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread''
    /usr/lib/ruby/1.8/webrick/server.rb:144:in `start''
    /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread''
    /usr/lib/ruby/1.8/webrick/server.rb:94:in `start''
    /usr/lib/ruby/1.8/webrick/server.rb:89:in `each''
    /usr/lib/ruby/1.8/webrick/server.rb:89:in `start''
    /usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
    /usr/lib/ruby/1.8/webrick/server.rb:79:in `start''
    /usr/lib/ruby/gems/1.8/gems/rails-0.12.1/lib/webrick_server.rb:21:in
`dispatch''
-- 
"The only thing necessary for the triumph of evil
is for good men to do nothing"
 Edmund Burke