I'm a Ruby newbie. I'm using TexMate Version 1.5.9 (1510) on Mac OS X Version 10.6.4. I'm trying to write a small Ruby snippet to get keyboard input as follows:<div><br><div><div>puts "What is your name? "</div>
<div>name = gets.chomp</div><div>puts "Hello #{name}"</div></div><div><br></div><div>I get the following TextMate error:</div><div><br></div></div><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.32">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 13.0px 0.0px; font: 13.0px 'Trebuchet MS'}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Trebuchet MS'; color: #0c2781}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Trebuchet MS'}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: right; font: 13.0px 'Trebuchet MS'; color: #0c2781}
span.s1 {color: #e4450b}
td.td1 {width: 67.0px; margin: 2.0px 2.0px 2.0px 2.0px; padding: 2.0px 2.0px 2.0px 5.0px}
td.td2 {width: 137.0px; margin: 2.0px 2.0px 2.0px 2.0px; padding: 2.0px 2.0px 2.0px 5.0px}
</style>
<p class="p1"><span class="s1"><b>NoMethodError:</b></span> private method ‘chomp’ called for nil:NilClass</p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle" class="td1">
<p class="p2"><a href="txmt://open?line=2&url=file:///Users/marcc/Documents/marccTechnical/Ruby/myRubyPrograms/sayhello.rb"><i>at top level</i></a></p>
</td>
<td valign="middle" class="td2">
<p class="p3">in <b>sayhello.rb</b> at line 2</p></td></tr></tbody></table>
<p class="p3">Program exited with code #1 after 0.02 seconds.</p><p class="p3"><br></p><p class="p3">I've googled pretty much every piece of information on Ruby keyboard input, changed that little snippet many times accordingly, but I could never get it to work. </p>
<p class="p3"><br></p><p class="p3">I realize that this question is not directly related to TextMate, but I'm hoping somebody can help me.</p><p class="p3"><br></p><p class="p3">Thanks in advance,</p><p class="p3"><br>
</p><p class="p3">Marc</p></div>