You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installed 2.0.0, in development all works fine, in production after all necessary configurations it breaks at
bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in `extract_tempfile'
Here is the full log:
Paperclip::AdapterRegistry::NoHandlerError (No handler found for #<PhusionPassenger::Utils::RewindableInput:0xb6a8b54 @io=#<PhusionPassenger::Utils::UnseekableSoc
ket:0xc07de90 @socket=#<UNIXSocket:fd 12>>, @rewindable_io=nil, @unlinked=false>):
paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:19:in handler_for' paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:29:infor'
bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in extract_tempfile' bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:137:input'
dav4rack (0.2.11) lib/dav4rack/resource.rb:116:in method_missing' dav4rack (0.2.11) lib/dav4rack/controller.rb:83:input'
dav4rack (0.2.11) lib/dav4rack/handler.rb:30:in call' bcms_webdav (2.0.0) lib/bcms_webdav/web_dav_middleware.rb:20:incall'
.....
Fortunately, a RewindableInput is duckalike to StringIO for this case, so Paperclip's StringioAdapter can be used to wrap your upload stream.
Inside the if block in your parse_raw_upload, at the end, do:
if @raw_file.class.name == 'PhusionPassenger::Utils::RewindableInput'
@raw_file = Paperclip::StringioAdapter.new(@raw_file)
end
In my project overwrote the Resource file,put it in initializer. Updated extract_tempfile method and changed line 192 to be:
if request.body.class.name == 'PhusionPassenger::Utils::RewindableInput'
uploaded_file = Paperclip::StringioAdapter.new(request.body)
else
uploaded_file = Paperclip.io_adapters.for(request.body)
end
Was able to move my files after that.
The text was updated successfully, but these errors were encountered:
Installed 2.0.0, in development all works fine, in production after all necessary configurations it breaks at
bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in `extract_tempfile'
Here is the full log:
Paperclip::AdapterRegistry::NoHandlerError (No handler found for #<PhusionPassenger::Utils::RewindableInput:0xb6a8b54 @io=#<PhusionPassenger::Utils::UnseekableSoc
ket:0xc07de90 @socket=#<UNIXSocket:fd 12>>, @rewindable_io=nil, @unlinked=false>):
paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:19:in
handler_for' paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:29:in
for'bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in
extract_tempfile' bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:137:in
put'dav4rack (0.2.11) lib/dav4rack/resource.rb:116:in
method_missing' dav4rack (0.2.11) lib/dav4rack/controller.rb:83:in
put'dav4rack (0.2.11) lib/dav4rack/handler.rb:30:in
call' bcms_webdav (2.0.0) lib/bcms_webdav/web_dav_middleware.rb:20:in
call'.....
Found the fix (http://stackoverflow.com/questions/15172439/paperclip-and-phusion-passenger-nohandlererror):
The example you're cribbing from expects the file stream to be a StringIO object, but Passenger is giving you a PhusionPassenger::Utils::RewindableInput object instead.
Fortunately, a RewindableInput is duckalike to StringIO for this case, so Paperclip's StringioAdapter can be used to wrap your upload stream.
Inside the if block in your parse_raw_upload, at the end, do:
if @raw_file.class.name == 'PhusionPassenger::Utils::RewindableInput'
@raw_file = Paperclip::StringioAdapter.new(@raw_file)
end
In my project overwrote the Resource file,put it in initializer. Updated extract_tempfile method and changed line 192 to be:
if request.body.class.name == 'PhusionPassenger::Utils::RewindableInput'
uploaded_file = Paperclip::StringioAdapter.new(request.body)
else
uploaded_file = Paperclip.io_adapters.for(request.body)
end
Was able to move my files after that.
The text was updated successfully, but these errors were encountered: