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

mistake in ruby foundation video?

under ruby foundation, the control flow video, at 4:32 when jason talks about 'retry if', i have the exact same code running in my sublime but when i exec it, terminal gives me an error message : invalid retry. what could possible be the problem. im running ruby 1.9.3. this is really frustrating

2 Answers

animals = %w(dog cat horse goat snake frog) count = 0

for animal in animals do puts "the current animal is #{animal}" break if count == 10 count += 1 retry if animal == 'horse' end

This is a known issue.. The retry keyword doesn't work that way anymore.