i'm trying to mimic a curl command Im using in ruby

curl -T file https://url

and here is want I'm using in ruby

myfile = File.read("test.txt")
url = URI.parse(uploadUrl)
Net::HTTP.version_1_1

conn = Net::HTTP.new(url.host )
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
conn.set_debug_output $stderr
conn.use_ssl=(true)

response = conn.start do |http|
  http.set_debug_output $stderr
 req = Net::HTTP::Put.new( path )
 http.request(req, myfile)

end

What am I doing wrong ?