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

awesome_print nil output

I have installed ruby and the awesome_print gem on multiple different hosts and OSes. Each one has the same output when I try to print the contents of a hash:

1.9.3-p385 :012 > ap treehouse { "business_name" => "Treehouse", "location" => "Treehouse Island", "phone_number" => "800-928-2130" } => nil

The first part of the output works fine. But at the bottom of the output, it should spit out the contents of the hash all on one line. Instead is says '=> nil'

How can I fix this?

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Ben,

This isn't something that can be fixed, exactly. The part that says "=> nil" is the return value of the last statement that is run. When printing something to the screen in irb there is no return value so it returns nil.

Ah cool. Thanks yo