I'm using princexml pdf generation in one of our apps and bump into this very weird problem. On our ubuntu box and local machines (MacBook Pro) pdfs are generated flawlessly. On the production xserve (running the rails app in production mode on a mongrel cluster), a 2.8 GHz Quad-Core Intel Xeon, strange things start happening. The following sections give back nil values in production, but valid values in development (script/console, …) even on the xserve itself:
@exe_path = `which prince`.chomp
# Actually call the prince command, and pass the entire data stream back.
pdf = IO.popen(path, "w+")
When i call the commands manually from the console, they work, giving back a valid PDF file. In production mode, both are nil, bombing the application. It's almost as if the ruby code is too fast to wait for the system call result. I've tried just about everything possible, even going as far as putting delays between each command, with no result whatsoever.
Has anyone experiences similar issues either on leopard server (default ruby bundled with the system) or an xserve?
Thanks in advance