Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

undefined method `[]' for nil:NilClass (NoMethodError) #2

christiangenco opened this Issue May 15, 2012 · 0 comments


None yet
2 participants

Occurs when running the example from README.md

% test.rb -n "hello"
test.rb:19:in `index': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/cgenco/.rvm/gems/ruby-1.9.2-p290/gems/shebang-0.1/lib/shebang.rb:78:in `run'
from test.rb:23:in `<main>'

All other methods work, and the error occurs if the flag used is -n or --name.

Line 19 of test.rb is:

puts "Your name is #{@options[:n]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment