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 YAML

Jesse Fister
Jesse Fister
11,968 Points

YAML question

I'm trying to use the load method to assign a variable called treehouse. I'm not clear why it won't pass?

Here is the question: Using the load method on the YAML class, assign the results of loading yaml_string in to another variable called treehouse.

yaml_string = "---\n:name: Treehouse\n:location: Portland, OR\n" require 'yaml' treehouse = YAML.load( "yaml_string" )

2 Answers

Angela Visnesky
Angela Visnesky
20,927 Points

Hi Jesse, Try removing your quotes from the treehouse = YAML.load( "yaml_string" ). Your are pulling in the variable named yaml_string, not an actual string. treehouse = YAML.load(yaml_string) works in the challenge.

Hi Jesse,

I think this should look something like:

treehouse = YAML.load(yaml_string)

I hope that works for you.

Steve.

Angela beat me to it! :-)