From: dblack@... Date: 2006-08-08T22:29:04+09:00 Subject: Re: prob with tutorial example Hi -- On Tue, 8 Aug 2006, nephish wrote: > Hey there, > just got the pickaxe book, and i am working thru the beginning. > > one example prog is this > > #!/usr/bin/ruby > > def fib_up_to(max) > i1, i2 = 1, 1 > while i1 <= max > yeild i1 > i1, i2 = i2, i1 + i2 > end > end > > fib_up_to(1000) {|f| print f, " "} > > when i try to execute it from a terminal, i get this: > > ./testl.rb:6:in `fib_up_to': undefined method `yeild' for main:Object > (NoMethodError) > from ./test.rb:11 > > am i doing something wrong? i have this installed in debian sarge. You're misspelling 'yield' :-) David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.