使用-e标志运行R时找不到sed目录 [英] Sed directory not found when running R with -e flag
问题描述
当我尝试运行以下命令时:
R --slave --no-save --no-restore -e "print('foo')"
When I try to run the following command:
R --slave --no-save --no-restore -e "print('foo')"
我得到:
/usr/local/bin/R: line 193: /usr/local/Library/ENV/4.3/sed: No such file or directory
ERROR: option '-e' requires a non-empty argument
I get:
/usr/local/bin/R: line 193: /usr/local/Library/ENV/4.3/sed: No such file or directory
ERROR: option '-e' requires a non-empty argument
显然,brew
最近将ENV
文件夹移到了新路径(请参见此处).我知道我可以轻松地对新的sed目录进行符号链接以解决此问题,但我想知道是否有更好的解决方法/修复方法(最终是否可以在R源代码中解决此问题).
Apparently brew
recently moved the ENV
folder to a new path (see here). I know I can easily symlink the new sed dir to fix the issue but I wanted to know if there is a better workaround / fix (and eventually if this will be fixed in the R source code).
推荐答案
之所以会发生这种情况,是因为brew
更改了这样的提交,因此,如果您在最近4天内运行了brew update
,这就是造成中断的原因.
This happens because brew
has changed it's paths in this commit so if you've run brew update
in the last 4 days, this is what has caused the breakage.
为此 blindjesse . 3839#issuecomment-233742983>答案,即brew reinstall -s r
.
Credit goes to blindjesse for this answer, which is to brew reinstall -s r
.
我尝试这个时遇到了其他一些问题.我没有安装X11,并且与tcl-tk
发生冲突,这意味着它在编译时还导致了其他一些失败:
I ran into some other issues when I tried this though. I didn't have X11 installed and I had a conflict with the tcl-tk
which meant that it caused some other failures when it was compiling so:
- 我从 https://www.xquartz.org 安装了XQuartz
- 将其符号链接到我的自制文件夹
ln -s /opt/X11/include/X11 /usr/local/include/X11
(请注意,您的自制目录可能不同) -
brew install homebrew/dupes/tcl-tk brew link --overwrite --force tcl-tk; brew unlink tcl-tk
-
brew reinstall -s r
- I installed XQuartz from https://www.xquartz.org
- Symlinked it to my homebrew folder
ln -s /opt/X11/include/X11 /usr/local/include/X11
(note that your homebrew directory may be different) brew install homebrew/dupes/tcl-tk brew link --overwrite --force tcl-tk; brew unlink tcl-tk
brew reinstall -s r
然后它对我有用.我认为,一旦r
瓶升级后,该问题就应该消失了,但就目前而言,这是我必须要做的.
And then it worked for me. I think once the r
bottle is upgraded this issue should disappear but for the moment this is what I had to do.
这篇关于使用-e标志运行R时找不到sed目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!