Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Server exception: NoMethodError (undefined method `bytesize' for nil:NilClass) #5

Closed
vohtaski opened this Issue Jul 11, 2010 · 3 comments

Comments

Projects
None yet
4 participants

Hello,
I am trying to use your library, however I have some problems.
Locally in my development environment, everything works perfectly,
but when I deploy it on the server I have the following below bug.
The ruby version and rails version are the same of both local and server machine.

Have you get into such thing ever?
Seem like a problem is with send_data function
but I can't figure it out

Thank you

Evgeny

Processing PrintController#print to pdf (for ______ at 2010-07-11 23:12:11) [GET]
Parameters: {"format"=>"pdf", "month"=>"7", "action"=>"print", "year"=>"2010", "controller"=>"print"}
Rendering print/print.pdf.erb

PRINCE XML PDF COMMAND
/usr/bin/prince --input=html --server --log=/home/vohtaski/public_html/trainandrace.com/releases/20100711230942/log/prince.log -s /home/vohtaski/public_html/trainandrace.com/releases/20100711230942/public/stylesheets/prince.css --silent - -o -

Sending data plans.pdf

NoMethodError (undefined method bytesize' for nil:NilClass): app/controllers/print_controller.rb:137:inprint'
app/controllers/print_controller.rb:128:in print' haml (2.2.20) lib/sass/plugin/rails.rb:20:inprocess'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/request_handler.rb:92:in process_request' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_request_handler.rb:207:inmain_loop'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:400:in start_request_handler' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:351:inhandle_spawn_application'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/utils.rb:184:in safe_fork' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:349:inhandle_spawn_application'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in __send__' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:inmain_loop'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:in start_synchronously' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:163:instart'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:209:in start' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:262:inspawn_rails_application'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:126:in lookup_or_add' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:256:inspawn_rails_application'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:80:in synchronize' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:79:insynchronize'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:255:in spawn_rails_application' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:154:inspawn_application'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:287:in handle_spawn_application' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:insend'
/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in main_loop' /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:instart_synchronously'

srbaker commented Jul 21, 2010

We're getting the same error. Any notes on this?

for me the problem was with prince, not with princely
If you run prince on the server with debug, you will see that it doesn't find the bold fonts.

After I copied Times New Roman bold fonts from my mac, it started to work normally.

I'm having the same issue. I went into my log, grabbed the command-line statement, modified it to point at the website, and got this response:

Fontconfig error: Cannot load default config file
sta|Loading document...
sta|Converting document...
prg|0
msg|err||no available fonts

Searching for "fontconfig", I found this http://www.princexml.com/doc/7.0/troubleshooting/#fontconfig

and I corrected the issue with:

sudo apt-get install fontconfig

@modsognir modsognir closed this Jan 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment