>> d = Time.now
=> Fri Dec 04 23:12:59 -0200 2009
>> d.in_time_zone("Buenos Aires")
=> Fri, 04 Dec 2009 22:12:59 ART -03:00
>> d = Time.now
=> Fri Dec 04 23:12:59 -0200 2009
>> d.in_time_zone("Buenos Aires")
=> Fri, 04 Dec 2009 22:12:59 ART -03:00
Using Rails and SQLite and this error is showed:uninitialized constant Encoding
So you have the wrong sqlite3 GEM installed. Please run: gem uninstall sqlite3
gem install sqlite3-ruby
post '/upload' do
unless params[:file] &&
(tmpfile = params[:file][:tempfile]) &&
(name = params[:file][:filename])
@error = "No file selected"
return haml(:upload)
end
STDERR.puts "Uploading file, original name #{name.inspect}"
while blk = tmpfile.read(65536)
# here you would write it to its final location
STDERR.puts blk.inspect
end
"Upload complete"
end
---------
%h1 Upload
%form{:action=>"/upload",:method=>"post",:enctype=>"multipart/form-data"}
%input{:type=>"file",:name=>"file"}
%input{:type=>"submit",:value=>"Upload"}
Thanks to @caffo for the tip.