Thanks to surj08 for finding this one.

Use dos2unix to correct the problem.
Code:
root@bt:/pentest/enumeration/goorecon# dos2unix goorecon.rb
Problem solved.