Shebang doesn't work - Linux Mint

if_play.rb - this works
j831526@j831526-UM700:~/code/Ruby/LittleBookOfRuby/1$ ./if_play.rb
Enter value for x:
2
Enter value for y:
2
x and y are equal fool
Now your REALLY need to piss off

-rwxrwxr-x 1 j831526 j831526 366 Oct 10 13:20 if_play.rb
Shebang: #!/usr/bin/ruby

object.rb - This fails
j831526@j831526-UM700:~/code/Ruby/LittleBookOfRuby/1$ ./object.rb
bash: ./object.rb: /usr/bin/ruby^M: bad interpreter: No such file or directory

-rwxrwxr-x 1 j831526 j831526 170 Oct 11 12:34 object.rb
Shebang: #!/usr/bin/ruby

Thanx … Charlie

Hello Charlie,

Do you see the ^M in the error message? It seems that the second file was edited using Windows, so that the line ended with < CR > < LF > instead of < LF > used in Linux.

See also https://www.atechtown.com/remove-ctrl-m-character/

Regards, Roman