R System Functions Always Returns Error 127

R system functions always returns error 127

As I mentioned in my comments, the R documentation reveals that in Windows the system() function does not launch a separate shell (if needed). This is why command line commands run with system(), but Notepad, which needs a separate window, does not run:

From the documentation for system():

The most important difference is that on a Unix-alike system launches a shell which then runs command. On Windows the command is run directly – use shell for an interface which runs command via a shell (by default the Windows shell cmd.exe, which has many differences from a POSIX shell).

Getting Exit Code 127 (Command not Found) from php exec()

So after further investigation.. I found that this was indeed a permissions issue. I had double checked that node and everything in the /bin folder had appropriate execute permissions..

What I had missed (and am not sure how it got changed) was that the /bin folder itself didn't have the appropriate execute permissions. Adding those immediately fixed my issue.

Why do I need to run find_rtools() before has_devel() = TRUE?

Basically, you did not put the rtools install location on the system PATH variable. So, devtools::find_rtools() is scanning the registry and adding it. The addition is only valid for the active session.

Now, the devtools::has_devel() is a very simple build and link of a C++ file. Thus, running devtools::has_devel() without the necessary environment (e.g. a valid rtools install) will yield a failure. In this case, the environment simply is not setup right as the system PATH variable has not been modified.

Make sure the following are in your system path variable:

C:\Rtools\bin and C:\Rtools\gcc-4.6.3\bin

Check within a clean R session:

Sys.getenv("PATH")


Related Topics



Leave a reply



Submit