Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

shell

sh

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 ?

like image 715
Ritesh Mehandiratta Avatar asked Aug 11 '13 13:08

Ritesh Mehandiratta


3 Answers

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]
like image 75
Babatunde Adeyemi Avatar answered Oct 19 '22 23:10

Babatunde Adeyemi


I had the same problem, and resolved it using Notepad++, by clicking Edit -> EOL Conversion -> Unix and then save the file.

like image 25
Laloi Avatar answered Oct 19 '22 22:10

Laloi


$PATH environment variable is set in ~/.bashrc, ~/.bash_profile or ~/.profile.

source the relevant configuration file or start a new bash terminal should solve the problem.

like image 35
Mingyu Avatar answered Oct 19 '22 23:10

Mingyu