Hey, I have put my site online and sometimes the site crashes when I want to create a pdf file. But when I reboot the server it works again. It crashes on: margin = PDF::Writer.cm2pts(1) Or pdf = PDF::Writer.prepress(:paper => "A4", :orientation => :landscape, :left_margin => margin, :right_margin => margin, :top_margin => 0, :bottom_margin => 0) Most of the time it is after the process: I have a page with a list of users, I display the info from the database (tables users and clients) like for the clientname => Clientname: <%= user.client.name %> But in the early stages of the site some users didnt have clients, so I got an nil error on the page. After that i wanted to create a pdf (total different section on the site), and get the errors. Anyone has any problem with this also?? And can help me?? Thanks in advance. Nick
On 12/5/05, Brutyn Nick <brutyn_nick-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> I have put my site online and sometimes the site crashes when I want to create a > pdf file. But when I reboot the server it works again.Can you post the backtrace that you get? -austin -- Austin Ziegler * halostatue-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org * Alternate: austin-/yODNl0JVVCozMbzO90S/Q@public.gmane.org
the wierd thing is it works sometimes sometimes not when i got an error
NoMethodError in Geotags#print_tag
undefined method `cm2pts'' for PDF::Writer:Class
#{RAILS_ROOT}/app/controllers/geotags_controller.rb:354:in `print_tag''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/base.rb:841:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/base.rb:841:in
`perform_action_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/filters.rb:332:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/benchmarking.rb:69:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/rescue.rb:82:in `perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/base.rb:365:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/base.rb:365:in
`process_without_session_management_support''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-
1.11.0/lib/action_controller/session_management.rb:116:in `process''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:in
`dispatch''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:141:in
`process_request''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:53:in
`process!''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:52:in
`each_cgi''
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in `each''
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in
`each_cgi''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:52:in
`process!''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/fcgi_handler.rb:22:in
`process!''
dispatch.fcgi:24
On 12/5/05, Brutyn Nick <brutyn_nick-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> the wierd thing is it works sometimes sometimes not when i got an error> NoMethodError in Geotags#print_tag > undefined method `cm2pts'' for PDF::Writer:ClassThis is quite weird, as it seems that something is not loading PDF::Writer (one of the instances, perhaps?) or is undefining parts of it. -austin -- Austin Ziegler * halostatue-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org * Alternate: austin-/yODNl0JVVCozMbzO90S/Q@public.gmane.org
Hi ! 2005/12/5, Austin Ziegler <halostatue@gmail.com>:> On 12/5/05, Brutyn Nick <brutyn_nick@hotmail.com> wrote: > > the wierd thing is it works sometimes sometimes not when i got an error > > > NoMethodError in Geotags#print_tag > > undefined method `cm2pts' for PDF::Writer:ClassOne thing I found is that PDF::Writer and ActiveRecord require different versions of Transaction::Simple. If you're running on Rails Edge, remove the simple.rb file from active_record/lib/vendor. Then, get Transaction::Simple 1.3.0, unpack into vendor, move lib/* to vendor/, and finally, require Transaction::Simple before PDF::Writer and ActiveRecord in config/environment.rb Not a simple workaround, but the best I found. Now, I have everything working. If this is of some help to you, please say so. I'll write an article for my blog about this. Bye ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails