Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error using rscript

I have a Homebrew version of R installed on my Mac (OS X, El Capitan 10.11.5). I've been using rscript successfully for about two weeks now. However, when I tried to run a script this morning using rscript file.r, I get the following error:

/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: line 209: /usr/local/Library/ENV/4.3/sed: No such file or directory

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

Of course, the error is saying that the file /usr/local/Library/ENF/4.3/sed cannot be found. Upon inspection of /usr/local/library this is, of course, true, but I don't know what the proper way to fix this is. It seems like rscript is just trying to access sed, which comes native on OS X.

Any ideas on what I can do?

This was found to be a bug contained within Homebrew/science. The error report can be found here: 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:

mkdir /usr/local/Library/ENV
ln -s /usr/local/Library/Homebrew/shims/super/ /usr/local/Library/ENV/4.3
like image 420
K. Shores Avatar asked Jul 18 '16 16:07

K. Shores


1 Answers

Instead of doing the symlinks as a temporary fix, and until the r bottle is fixed. Short answer is to brew reinstall -s r.

I posted this answer (with an explanation to why this occurs) on the duplicate question which solved this problem for me.

like image 111
cdaloisio Avatar answered Sep 28 '22 02:09

cdaloisio