rubyruby-on-rails-3.2rexml

Deployment fails because of obscure REXML setting?


I'm using EngineYard for my production system. My deployment has Ruby 1.9.3p392. I develop on Ruby 1.9.3p429.

I get notifications from a 3rd party server that contains large XML files (larger than 10K anyway).

After a new deployment, for some reason, all of my notifications from this party are FAILING because the XML is greater than the 10K limit.

So on my dev instance I added the following line to application.rb:

REXML.entity_expansion_text_limit=102400

But that makes my deployment fail. So I look around and try another iteration:

REXML::Document.entity_expansion_text_limit=102400

Nope, that particular version of Ruby has no idea what I'm talking about.

What can I do to overcome this 10K default?


Solution

  • For some reason, I REXML::Document needs to be required on EngineYard. Here's what I did to fix my deployment.

    In application.rb:

    require 'rexml/document' REXML::Document.entity_expansion_text_limit=102400

    That appears to have done it.