Command not file

Hello Kirupa,

I am trying to run a simple Ruby file but when I try to compile it in GitHub it indicates that the commands are not found? What could this mean?

You should probably use the command ruby new_files.rb instead of just new_files.rb. You’re seeing errors now because your terminal is interpreting your Ruby script as a shell script instead.

The other way to fix it is to put something like #!/usr/bin/env ruby as the first line at the top of your .rb file. I don’t know if that’ll work in Git Bash on Windows, though.


I entered the last code but I am still getting the same error. Would it be that the Ruby compiler is not communicating with my file??

After rereading your post putting ruby infront of the file name works!

Thank you so much

1 Like