env: ruby\r: No such file or directory
If you are working on a Unix / Mac, then this error is because you have the incorrect line endings.
here are some steps to correct.
-
Set your line endings correctly, and have git manage how it handles them.
$ git config --global core.autocrlf input
Then, in your directory, you are going to basically convert all of the files.
-
Now you have to run the following
$ find ./ -type f -exec dos2unix {} \;
This will cycle through all of your files, and convert them. This will solve the error. Add your changes. Commit them, and you should be good to go.
For those of you who got "find: ‘dos2unix’: No such file or directory" error: sudo apt install dos2unix – RealMan Jul 26 '17 at 14:59
-
Note that that find command may be excessive... this point is arguable; it may well be fine, but it may be overkill in some situations. Another possible route (for step 2 in this answer) is
git rm -r --cached .
followed bygit reset --hard HEAD
... which is likely faster (if nothing else, it won't run dos2unix on files in the.git
housekeeping directory!)... This has potential gotchas as well (probably quite fine if you're running from a "clean" checkout, though), but thought I'd at least mention it. – lindes Jul 13 '19 at 0:42
上一篇: 美军拟将机械狗投入战场:可背负超重武器
下一篇: AngularJS表单验证
推荐阅读
-
【openWRT】编译问题/usr/bin/env: node: No such file or directory
-
Homebrew 安装 node 后,npm报 env: node no such file or directory
-
idea env: node: No such file or directory
-
【/usr/bin/env: node: No such file or directory】 的解决办法
-
Python Error: /usr/bin/env: python3: No such file or directory
-
报错:/usr/bin/env: php: No such file or directory
-
linux 安装phpunit5 报错 /usr/bin/env :php: No such file or directory
-
linux composer centos7 /usr/bin/env: php: No such file or directory
-
CentOS bug : /usr/bin/env: 'python': No such file or directory
-
R/library/grDevices/libs//cairo.so libXext.so.6: object file: No such file or directory