Bug #1414
closedNameError (undefined method `path' for class `ActionController::UploadedStringIO')
Description
=begin
See also Ruby bug #1271
Processing ApplicationController#create (for 127.0.0.1 at 2009-04-26 19:00:26) [POST]
Parameters: {"authenticity_token"=>"cP8NCg4Exg4e22Ijs/bRLpgzjnVwmwspKi8QnF4Xi40=", "mugshot"=>{"uploaded_data"=>#File:/var/folders/JP/JP7pZWhAHLy-es7AYViHF++++TI/-Tmp-/RackMultipart50621-2}, "commit"=>"Create"}
NameError (undefined method path' for class
ActionController::UploadedStringIO'):
internal:prelude:8:in synchronize' thin (1.0.0) lib/thin/connection.rb:63:in
pre_process'
thin (1.0.0) lib/thin/connection.rb:54:in process' thin (1.0.0) lib/thin/connection.rb:39:in
receive_data'
eventmachine (0.12.6) lib/eventmachine.rb:240:in run_machine' eventmachine (0.12.6) lib/eventmachine.rb:240:in
run'
thin (1.0.0) lib/thin/backends/base.rb:57:in start' thin (1.0.0) lib/thin/server.rb:150:in
start'
The problem is triggered when using attachment_fu, with file_storage, to load a jpg image into a rails application.
The problem occurs on only the first create after restarting the server (thin). After the first failed create, a browser reload with no change in data will succeed. Also all following creates will succeed.
I'm not assuming this to be a ruby bug but am unable to track the problem any closer than prelude.rb in the ruby source.
The previous issue (bug #1271) looks to be the same as mine. If I use webrick instead of thin for the server I get a server crash.
I've attached a gz tarfile of the minimum needed to repeat the problem. I have not included rails, thin, or any other of the standard gems. The mugshots/vendor/plugins does contain attachment_fu as I needed to submit a change to that gem (: no longer and alias for then). I've included a GEM-LIST (gem list) file fyi.
Here are the steps:
In terminal:
gzcat mugshots.tar.gz | tar xvf -
cd mugshots
rake db:migrate
script/server thin
In browser:
http://localhost:3000/mugshots/new
use "Browse..." to select ".../mugshots/DSCN0925.jpg"
use "Create" to demonstrate problem
use browser "Reload Current Page" and "Resend" buttons to successfully load attached image
click "New shot" link
use "Browse..." to select ".../mugshots/DSCN0913.jpg"
use "Create" to successfully load attached image
=end
Files
Updated by matz (Yukihiro Matsumoto) over 15 years ago
=begin
Hi,
I am afraid that it's a bug in Rails or its plugin. Could you isolate
the problem if it's a bug in Ruby itself?
matz.
In message "Re: [ruby-core:23326] [Bug #1414] NameError (undefined method path' for class
ActionController::UploadedStringIO')"
on Mon, 27 Apr 2009 15:35:02 +0900, Rick Lloyd redmine@ruby-lang.org writes:
|Processing ApplicationController#create (for 127.0.0.1 at 2009-04-26 19:00:26) [POST]
| Parameters: {"authenticity_token"=>"cP8NCg4Exg4e22Ijs/bRLpgzjnVwmwspKi8QnF4Xi40=", "mugshot"=>{"uploaded_data"=>#File:/var/folders/JP/JP7pZWhAHLy-es7AYViHF++++TI/-Tmp-/RackMultipart50621-2}, "commit"=>"Create"}
|
|NameError (undefined method path' for class
ActionController::UploadedStringIO'):
| internal:prelude:8:in synchronize' | thin (1.0.0) lib/thin/connection.rb:63:in
pre_process'
| thin (1.0.0) lib/thin/connection.rb:54:in process' | thin (1.0.0) lib/thin/connection.rb:39:in
receive_data'
| eventmachine (0.12.6) lib/eventmachine.rb:240:in run_machine' | eventmachine (0.12.6) lib/eventmachine.rb:240:in
run'
| thin (1.0.0) lib/thin/backends/base.rb:57:in start' | thin (1.0.0) lib/thin/server.rb:150:in
start'
|
|The problem is triggered when using attachment_fu, with file_storage, to load a jpg image into a rails application.
=end
Updated by rick (Rick Lloyd) over 15 years ago
=begin
I think you are correct. I first assumed that, since the error was induced by swapping 1.9.2dev for 1.8.7p72, that ruby was the culprit. A naive assumption of course.
A new version of rake (1.0.0) was introduced which changes the behavior of the error. I'm going to start conversing with the rack folks and will keep you posted.
Rick
=end
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
=begin
Hi,
At Mon, 27 Apr 2009 15:35:02 +0900,
Rick Lloyd wrote in [ruby-core:23326]:
NameError (undefined method
path' for class
ActionController::UploadedStringIO'):
Although I don't know what ActionController::UploadedStringIO
is, I suspect it may be relevant that StringIO#path is no
longer defined.
--
Nobu Nakada
=end
Updated by rick (Rick Lloyd) over 15 years ago
=begin
So the current info seems to point to multiple problems related to the StringIO changes in Ruby and introduction evolution of I18N in Rails and other gems. My specific problem was "fixed" by adding two patches - one to rack and one to ActionController.
So, thanks again for your help with this.
This issue is not a ruby bug.
=end
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
- Status changed from Open to Third Party's Issue
=begin
=end