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
Will Lam
7,027 PointsUndefined local variable or method
Hey guys,
I'm doing the Ruby Foundations module right now and I'm coming across a problem that wasn't addressed..
I'm encountering this error here
I'm not sure how I can get around it? Where would I define the variable? I was following along Jason's instructions.. but couldn't pinpoint why this error is popping up.
Thanks for your help!
1 Answer
Charles Massry
12,253 PointsIn Ruby, you define a variable simply by typing in the name of a variable and setting it equal to its value. For example, control_flow = 1 this would create an integer called control_flow with the value of one. Also make sure that it is a local variable for example defined in a function and called outside of it