欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

env: ruby\r: No such file or directory

程序员文章站 2022-03-08 20:36:40
...

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.

  1. 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.

  1. 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 by git 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

Link of this question

 

相关标签: CocoaPods