Segmentation fault on Windows

J

Jyo Ni

Hi,

When I try to run the following program I get a segmentation fault:
require 'rubygems'
require 'json'
require 'net/http'
def testrsv()
base_url =
"http://10.221.112.10:8080/reserve-online/reservations?status=emailed&format=json"
url = "#{base_url}"
resp = Net::HTTP.get_response(URI.parse(base_url))
data = resp.body
# data structure - a hash
result = JSON.parse(data)
# if the hash has 'Error' as a key, we raise an error
result['reservations']['reservation'].each { |result|
print "#{result['ean']} => #{result['status']}\n"
}

end

C:/Users/SudJyo/AppData/Local/Temp/rb276D.tmp:21: [BUG] Segmentation
fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.


Can anyone help me finding the cause of this issue?
Thanks,
Jyo
 

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

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top