Welcome aboard! We are happy you are here and wish you good net-raft!
require 'json'
file = File.read('C:/Users/mypc/Documents/NetBeansProjects/MyRuby/test/newjson.json') // windows localhost
data_hash = JSON.parse(file)
puts data_hash['comments']
// newjson.json
{
"lang" : "Ruby on Rails",
"url" : "https://www.ruby-lang.org/en/",
"comments" : {
"1":"ruby is the best",
"2":"ruby is crazy"
}
}
The most helpful RUBY solutions