6

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
3
  • Do you call sed in your file.r?
    – Roland
    Commented Jul 18, 2016 at 16:33
  • are you able to access sed utility outside this script. i.e from your unix prompt. Looks like a problem with PATH environment variable ?
    – chidori
    Commented Jul 18, 2016 at 16:34
  • 1
    Duplicate of stackoverflow.com/q/38440350/1968 Commented Jul 18, 2016 at 16:52

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.