concept local variable in category ruby

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.
Local variables start with a lowercase letter or an underscore and consist of letters, underscores, and/or digits. x, string, abc, var1, start_value, and firstName are all valid local variable names. Note, however, that the Ruby convention is to use underscores rather than camel case when composing local variable names from multiple words—for example, first_name rather than firstName.
Instance variables, which serve the purpose of storing information within individual objects, always start with a single at-sign (@) and consist thereafter of the same character set as local variables—for example, @age and @last_name. Although a local variable can’t start with an uppercase letter, an instance variable can have one in the first position after the at-sign (though it may not have a digit in this position). But usually the character after the at-sign is a lowercase letter.
The local in local variables pertains to the fact that they have limited scope: a local variable is only visible in a limited part of a program, such as a method definition. Local variable names can be reused in different scopes. You can use, say, the variable name x in more than one place, and as long as those places have distinct scopes, the two x variables are treated as completely separate. (Remember that conventional Ruby style prefers under_score names over camelCase names for local variables.)
Scope is an important topic in its own right, and we’ll get deeply into it in chapter 5. You can start getting familiar with some key aspects of it now, though, as you examine how local variables come and go. The classic case of local scope is a method definition. Watch what happens with x in this example:
$ ruby -e "x" -e:1:in `<main>': undefined local variable or method 'x' for main:Object (NameError)