Rails warning shebang line ending with \r - Lessons Learned 8

I was getting following error.

$ rails s
/home/uday/.rbenv/versions/2.7.5/bin/ruby: warning: shebang line ending with \r may cause problems

How I fixed it?

I navigated to the ruby file located in the bin folder(bin/rails). At the bottom of the Visual Studio Code editor(status bar), you should be able to see a button CRLF(control character). Click on it and change it to LF.

This is because Windows uses by default uses the CRLF control character and now that you are using a Windows subsystem for Linux, the control character should be LF

Rating: