env: ruby\r: No such file or directory

后端 未结 4 738
失恋的感觉
失恋的感觉 2021-02-08 15:52

I have Rails project. When I try to run any rake task or rails server it give me this error

env: ruby\\r: No such file or directory

4条回答
  •  遇见更好的自我
    2021-02-08 16:34

    If you are working on a Unix / Mac, then this error is because you have incorrect line endings.

    Here is a solution using dos2unix; you may need to install this program on your system. If apt is available, you can use sudo apt install dos2unix.

      1. Set your line endings correctly, and have git manage how it handles them:
    git config --global core.autocrlf input
    
      1. In your directory you are going to convert all of the files by running:
    find ./ -type f -exec dos2unix {} \;
    

    This will cycle through all of your files, converting them. and solving the problem. Add your changes. Commit them, and you should be good to go.

提交回复
热议问题