Non-repeatable "undefined error 'path'" error

I’m seeing an error the first time I run a create after restarting my
webserver (thin). Same create succeeds on all following attempts.


ruby 1.9.2dev
rails 2.3.2
rack 0.9.1
thin 1.0.0
rmagick 2.9.1

I’m trying to get attachment_fu working in my current setup and have
run into a rather strange situation. The first image I try to load
produces the following diag in the logfile:

Processing ApplicationController#create (for at 2009-04-25
09:50:27) [POST]
Parameters: {“authenticity_token”=>“EjZpcSwOswNpjZCHHhypx/
LdfR8m0AmW1Z2caF4/BVI=”, “mugshot”=>{“uploaded_data”=>#<File:/var/

NameError (undefined method path' for classActionController::UploadedStringIO’):
internal:prelude:8:in synchronize' thin (1.0.0) lib/thin/connection.rb:63:inpre_process’
thin (1.0.0) lib/thin/connection.rb:54:in process' thin (1.0.0) lib/thin/connection.rb:39:inreceive_data’
eventmachine (0.12.6) lib/eventmachine.rb:240:in run_machine' eventmachine (0.12.6) lib/eventmachine.rb:240:inrun’
thin (1.0.0) lib/thin/backends/base.rb:57:in start' thin (1.0.0) lib/thin/server.rb:150:instart’

If I then simply reissue the request from the browser the create
action succeeds. From that point on, all attempts to follow the new-

create sequence succeed first try.

Out of curiosity, I tried the same with a new webrick in place of
thin. In that case the first attempt produces:

Processing ApplicationController#create (for ::1 at 2009-04-25
10:20:30) [POST]
Parameters: {“authenticity_token”=>“EjZpcSwOswNpjZCHHhypx/
LdfR8m0AmW1Z2caF4/BVI=”, “mugshot”=>{“uploaded_data”=>#<File:/var/

NameError (undefined method path' for classActionController::UploadedStringIO’):
internal:prelude:8:in synchronize' /opt/RoR/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice’
/opt/RoR/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /opt/RoR/lib/ruby/1.9.1/webrick/server.rb:183:inblock in

The browser retry yields a “Webrick - stopped (abort trap)” so no
further attemps are possible. Ignoring for a momemt the different
ways the two servers handle the error allows me to focus on the

NameError (undef…‘path’…‘Act…::UploadedStringIO’)
internal:prelude:8:in `synchronize’

Unfortunately, that’s as far as I can get. I’m clueless on how to
resolve the ‘synchronize’ reference. There’s obviously a point in the
sequence (?rack?) that is not correctly dealing with the

The fact that thin will allow a do-over is fortunate for me because it
lets me believe the problem isn’t in my code (for a change;-).

Actually it’s not my code but the trivial “mugshots” example that can
be found through attachment_fu/README. But, in the interest of full

from mugshots_controller.rb

def new
@mugshot =

def create
@mugshot =[:mugshot]) “Mugshot attributes hash: #
{@mugshot.attributes.inspect}” “Mugshots_url: #{mugshots_url.inspect}”
flash[:notice] = ‘Mugshot was successfully created.’
redirect_to mugshots_url
render :action => :new

from mugshots/new.html.erb

<%= error_messages_for :mugshot %>

<% form_for(:mugshot, :url => mugshots_path,
:html => { :multipart => true }) do |f| -%>

Upload A Mugshot: <%= f.file_field :uploaded_data %>

<%= submit_tag 'Create' %>

<% end -%> --------------------------

thanks in advance,

I think it’s a bit too early to run all that stuff on 1.9.2.


certainly a valid reply, not exactly what I was expecting though…

On Apr 25, 1:21 pm, Dmitry S. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs