Why can't access a local variable inside a method in Ruby?
I have a ruby file named test.rb

    ff="ff"
    def test
      puts ff
    end

I execute it, got error:
test.rb:3:in `test': undefined local variable or method `ff' for main:Object (NameError)

What's the reason of this? Is there any resouces document to explain it?
Why can't access a local variable inside a method in Ruby?
===

I have a ruby file named test.rb

    ff="ff"
    def test
      puts ff
    end

I execute it, got error:
test.rb:3:in `test': undefined local variable or method `ff' for main:Object (NameError)

What's the reason of this? Is there any resouces document to explain it?