Yaml to json in ruby

Hello ALL,

Very much new to ruby. i have a yaml file ( xyz.yaml ) and i wanna write
a code in ruby which can give me o/p in json. Please help


require’json’ and require’yaml’
puts YAML.load(File.read(“xyz.yaml”)).to_json

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs