Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7161

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

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: undefined local variable or method `city' for #<Context:0x10099d8>
Date Fri, 11 Dec 2015 07:09:22 +0100
Lines 24
Message-ID <dcv7kjFrgr0U1@mid.individual.net> (permalink)
References <9589d281-0b8c-4c61-ba55-6992cc2957c8@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net WYC9qEeNJ7k1aKCR1lVfWwPIbbbHlYBLTX+YnyNqnQeg/HZjU=
Cancel-Lock sha1:yjUP0E+S2bk0W6RyJeko+01eJQs=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
In-Reply-To <9589d281-0b8c-4c61-ba55-6992cc2957c8@googlegroups.com>
Xref csiph.com comp.lang.ruby:7161

Show key headers only | View raw


On 11.12.2015 07:00, gengyangcai@gmail.com wrote:
> 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 ...

Obviously #city is undefined at the point of execution.  You see this 
effect:

$ ruby2.0 -e 'x=city'
-e:1:in `<main>': undefined local variable or method `city' for 
main:Object (NameError)

But we are lacking context - or rather: Context.

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

undefined local variable or method `city' for #<Context:0x10099d8> gengyangcai@gmail.com - 2015-12-10 22:00 -0800
  Re: undefined local variable or method `city' for #<Context:0x10099d8> Robert Klemme <shortcutter@googlemail.com> - 2015-12-11 07:09 +0100
    Re: undefined local variable or method `city' for #<Context:0x10099d8> gengyangcai@gmail.com - 2015-12-10 22:17 -0800
  Re: undefined local variable or method `city' for #<Context:0x10099d8> Pratap Patil <pratap477@gmail.com> - 2016-10-21 04:38 -0700

csiph-web