mod_ruby CGI file upload fails because of TypeError ?

L

lg

hi guys,

i have written an ruby script handling fileupload using the regular
Ruby CGI class.

....
if tmpfile.kind_of?(Tempfile)
print "creating via FileUtils !!"
FileUtils.cp tmpfile.local_path.untaint, filename.untaint
print "i was copied !!"
else
File.open( filename.untaint, "wb"){ |file|
file << tmpfile.read
}
end
....

when executing the script i get the following strange error (copied
from apaches error.log)

/usr/lib/ruby/1.8/delegate.rb:90: warning: already initialized constant
Delegater
/usr/lib/ruby/1.8/delegate.rb:91: warning: already initialized constant
SimpleDelegater
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: error in ruby
[Thu Jan 05 22:31:52 2006] [error] mod_ruby:
/usr/lib/ruby/1.8/tempfile.rb:12: superclass mismatch for class
Tempfile (TypeError)
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/auto-reload.rb:77:in `load'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/auto-reload.rb:77:in `require'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/cgi.rb:986:in `read_multipart'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/cgi.rb:983:in `loop'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/cgi.rb:983:in `read_multipart'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/cgi.rb:1103:in `initialize_query'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/cgi.rb:2269:in `initialize'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/var/www/ab/import.rbx:5:in `new'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/var/www/ab/import.rbx:5
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Thu Jan 05 22:31:52 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler'

I am using Apache/2.0.54, mod_ruby and Ruby 1.8.2 (2005-04-11) on
Debian Sarge.

can anyone help me out what happens ?

many regards,

lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top