当我尝试运行下面的命令:
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
显然,最近brew
移动ENV
文件夹到一个新的路径(见here)。我知道我可以很容易地符号链接的新的sed目录来解决这个问题,但我想知道是否有更好的解决方法/修复(最终如果这将是固定在R源代码)。
这是因为brew
已经改变了它的路径在this commit所以如果你在过去的4天运行一次brew update
,这是什么原因造成的破损。
幸得blindjesse这个answer,这是brew reinstall -s r
。
我遇到了其他一些问题,当我尝试这样做,虽然。我没有安装X11和我有这意味着它引起了一些其他故障,当它被编译所以tcl-tk
冲突:
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
然后,它为我工作。我认为,一旦r
瓶升级这个问题应该消失,但就目前而言,这是我必须做的。
升级到塞拉利昂,尝试了上述命令,并在此方向:https://github.com/Homebrew/homebrew-science/issues/4338。之后,我还重新安装将R内核这里的操作说明:https://github.com/IRkernel/IRkernel,事情又开始工作。 OY合租。
要重新安装将R核心,在终端启动R和输入以下内容:
install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
而不是具有sed
的路径硬编码的,一个简单的解决方法是编辑将R脚本,并与线193改变
SED=$(which sed)