On Apr 30, 2007, at 7:04 PM, Greg wrote:

#!/usr/bin/env ruby

puts 'Hello there, and what\'s your name?'
name = gets.chomp
puts 'Your name is ' + name + '? What a lovely name!'

When you run the script from within BBEdit, there is no TTY to read/ write from.

gets returns nil, and you call a method on nil, which results in your error.

<fileName>:11: private method `chomp' called for nil:NilClass (NoMethodError)


Jim


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to