Yosemite has a bug wherein some environment variables, including PATH
, appear twice in a program's environment with different values. For instance, you might notice that Sys.getenv("PATH")
will show you one PATH, and system("echo $PATH")
will show you an entirely different one.
I expect that most of your problems are due to this bug.
There are a few workarounds you can try immediately:
You can manually forward PATH
yourself. Try this:
> system2("man", "pdflatex", env=paste0("PATH=", Sys.getenv("PATH")))
Or, you can start RStudio from Terminal:
$ open /Applications/RStudio.app
Both the R and RStudio engineers have implemented workarounds in the last few days. R (as of 3.1.2) and RStudio (as of 0.98.1087) should behave as you'd expect.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…