简体   繁体   English

使用rscript时出错

[英]Error using rscript

I have a Homebrew version of R installed on my Mac (OS X, El Capitan 10.11.5). 我在我的Mac上安装了一个自制的R版本(OS X,El Capitan 10.11.5)。 I've been using rscript successfully for about two weeks now. 我已经成功使用rscript大约两周了。 However, when I tried to run a script this morning using rscript file.r , I get the following error: 但是,当我今天早上尝试使用rscript file.r运行脚本时,出现以下错误:

/usr/local/Cellar/r/3.3.1/R.framework/Versions/3.3/Resources/bin/R: line 209: /usr/local/Library/ENV/4.3/sed: No such file or directory /usr/local/Cellar/r/3.3.1/R.framework/Versions/3.3/Resources/bin/R:209行:/usr/local/Library/ENV/4.3/sed:没有这样的文件或目录

/usr/local/Cellar/r/3.3.1/R.framework/Versions/3.3/Resources/bin/R: line 209: /usr/local/Library/ENV/4.3/sed: No such file or directory /usr/local/Cellar/r/3.3.1/R.framework/Versions/3.3/Resources/bin/R:209行:/usr/local/Library/ENV/4.3/sed:没有这样的文件或目录

Fatal error: cannot open file '': No such file or directory 致命错误:无法打开文件'':没有这样的文件或目录

(That is the full error. Yes, it appears twice, it is not a typo.) (这是完整的错误。是的,它出现两次,这不是一个错字。)

After getting that error, I tried uninstalling and reinstalling r with homebrew. 在收到该错误后,我尝试卸载并使用自制程序重新安装r。 I get the same error. 我犯了同样的错误。 The only other package that I have installed since last using rscript (to the best of my knowledge) is pspp, but I see no reason why this should have affected rscript. 自从上次使用rscript以来我唯一安装的其他软件包(据我所知)是pspp,但是我没有理由认为这应该影响到rscript。

Of course, the error is saying that the file /usr/local/Library/ENF/4.3/sed cannot be found. 当然,错误是说无法找到文件/usr/local/Library/ENF/4.3/sed Upon inspection of /usr/local/library this is, of course, true, but I don't know what the proper way to fix this is. 在检查/usr/local/library这当然是真的,但我不知道解决这个问题的正确方法是什么。 It seems like rscript is just trying to access sed, which comes native on OS X. 似乎rscript只是试图访问sed,它在OS X上是原生的。

Any ideas on what I can do? 关于我能做什么的任何想法?

This was found to be a bug contained within Homebrew/science. 这被发现是Homebrew / science中包含的错误。 The error report can be found here: https://github.com/Homebrew/homebrew-science/issues/3839 错误报告可以在这里找到: https//github.com/Homebrew/homebrew-science/issues/3839

Temporary fix for this (tested on OS X, as of 07-19-2016 12:54 PM central) from ck37 on github: 暂时修复此问题(在OS X上测试,截至2016年7月17日12:54 PM中央)来自github上的ck37:

mkdir /usr/local/Library/ENV
ln -s /usr/local/Library/Homebrew/shims/super/ /usr/local/Library/ENV/4.3

Instead of doing the symlinks as a temporary fix, and until the r bottle is fixed. 而不是将符号链接作为临时修复,直到r瓶被修复。 Short answer is to brew reinstall -sr . 简短的回答是brew reinstall -sr

I posted this answer (with an explanation to why this occurs) on the duplicate question which solved this problem for me. 我在重复的问题上发布了这个答案 (解释为什么会发生这种情况),这个问题为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM