Undefined local variable or method `city' for #<Context:0x10099d8>

first_name = gets.chomp
last_name = city

undefined local variable or method `city’ for #Context:0x10099d8

What does “undefined local variable or method `city’ for
#Context:0x10099d8” mean? Tried searching in Google, but no results
were returned …

It’s correct the message that return.
What is city?
Another variable or what?
You must define city first and next you can associate to other variable.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs