[LRUG] AJAX file uploads and content types

Richard Taylor richard at richt.co.uk
Thu Apr 5 03:15:12 PDT 2012


Hi Andy,

Unicorn not picking up a new bundled gem rings a bell.  I have the following in my unicorn.rb config file to combat this:

before_exec do |server|
  ENV["BUNDLE_GEMFILE"] = "#{app_root}/current/Gemfile"
end


Basically, on graceful restart something is keeping a reference to the expanded path of the old gemfile (not via the symbolic link) so you need to make sure bundler knows it should use the new Gemfile in the new release folder.

-- 
Richard Taylor


On Thursday, 5 April 2012 at 08:07, Andrew Stewart wrote:

> 
> On 4 Apr 2012, at 10:29, Andrew Stewart wrote:
> > The basic process is this:
> > 
> > 1) User submits a 'remote' form with a file input.
> > 2) Remotipart's javascript intercepts the form submission, creates an iframe with the form data in it, and posts the iframe's form to the server (with content type text/html).
> > 3) A remotipart middleware intervenes in the request to convert the request to text/javascript.
> > 4) My controller action saves the image and responds by rendering create.js.erb.
> > 
> > The problem seems to be at step 3. To gather more information I added `$stderr.puts "useful info"` etc to the remotipart middleware but I can't find the output in my unicorn logs.
> 
> To follow up on this, the problem was solved by a hard restart of Unicorn. I'm not sure yet why the normal zero-downtime restarts didn't pick up the bundled remotipart gem with its middleware, given that other code introduced at the same time was being served by the web processes, but I'm going to take that up on the Unicorn list.
> 
> Thanks everybody for the suggestions.
> 
> Cheers,
> 
> Andy Stewart
> ----
> http://airbladesoftware.com
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org (mailto:Chat at lists.lrug.org)
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120405/0cdc3e2f/attachment-0003.html>


More information about the Chat mailing list