Now, just found this issue yesterday. This happen on Vagrant that have Linux guest machine and using Windows as host machine.
Our shebang script suddenly give us
: No such file or directory
In one of the developer machine. But it works normally on the others. So I try to take a look at it.
The error is happening on one of the machine that is using Windows as the host machine and it does not happening on Linux / Mac’s. So it must be Windows thing right?
Judging from the editor – I cannot see any differences from the shebang lines below.
But suddenly I remember that Windows use CRLF and Linux use LF as line endings.
Never heard of such case in shebang script, I try to prove it by creating a simple hello world that is using proper LF line ending and it works properly.
So yeah if you got : No such file or directory error on your shebang script and you use Vagrant and have multi-OS developers – check your line-ending 🙂
- Using Vagrant
- Using Linux as Guest Machine
- Using Windows
- Have some shebang scripts
- Does not properly set .gitattributes to properly resolve line endings
- Properly set .gitattributes to properly force line ending – we use
text eol=lf(see Github Article about dealing with Line Endings)
- Temporary fix to use
dos2unixtool to convert the file line-ending