getting error /usr/bin/env: sh: No such file or directory when running command play

Ritesh Mehandiratta picture Ritesh Mehandiratta · Aug 11, 2013 · Viewed 49.6k times · Source

I am a beginner on Play framework . I just extract Play framework files and extracted them and gave the path of play directory in $PATH global variable. After this when I run the the command on ubuntu play help, its giving me below error:

/usr/bin/env: sh: No such file or directory

Any clue why I am facing this error and how to resolve it ?

Answer

Babatunde Adeyemi picture Babatunde Adeyemi · Jan 27, 2014

This error usually happens if the script has windows line endings instead of unix line endings.

Try running dos2unix on the script and try running your command again to see if you get the same error.

dos2unix [filename]