Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Core and Standard Library Ruby Standard Library: Part 2 JSON

Sean Flanagan
Sean Flanagan
33,235 Points

No console output

Hi. Whenever I type in commands and press Enter, nothing happens.

irb(main):006:0> my_hash = { name: "Sean", email: "sean@teamtreehouse.com", favourite_           
numbers: [1, 2, 3]                                                                               
irb(main):007:1> my_hash = { name: "Sean", email: "sean@teamtreehouse.com", favourite_           
numbers: [1, 2, 3] }                                                                             
irb(main):008:1> JSON.dump(my_hash)                                                              
irb(main):009:1> json_output.class                                                               
irb(main):010:1> JSON.parse(json_output)                                                         
irb(main):011:1> JSON.load( File.new("./example.json") )                                         

Is it me or is there a technical issue? Thanks.

andi mitre
andi mitre
Treehouse Guest Teacher

try saving to a variable and then printing that variable

2 Answers

Daniel Samer
Daniel Samer
14,473 Points

You are missing an } at the declaring of the first vairable, so IRB thinks that you are still declaring the first hash

irb(main):006:0> my_hash = { name: "Sean", email: "sean@teamtreehouse.com", favourite_           
numbers: [1, 2, 3]  }                                                                             
irb(main):007:1> my_hash = { name: "Sean", email: "sean@teamtreehouse.com", favourite_           
numbers: [1, 2, 3] }                                                                             
irb(main):008:1> JSON.dump(my_hash)                                                              
irb(main):009:1> json_output.class                                                               
irb(main):010:1> JSON.parse(json_output)                                                         
irb(main):011:1> JSON.load( File.new("./example.json") )      
Sean Flanagan
Sean Flanagan
33,235 Points

Thanks Daniel. I just looked at my code again and now I see the missing closing brace like you said. You've earned an up vote and Best Answer for your help. :)