Skip to content

Instantly share code, notes, and snippets.

@sckott
Last active January 31, 2017 20:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckott/18e17f12de56cc411105 to your computer and use it in GitHub Desktop.
Save sckott/18e17f12de56cc411105 to your computer and use it in GitHub Desktop.

A friend is trying to get Rtools installed correctly on her windows machine. It seems to install fine, but then at the end, she gets an error. The error below shows up in the Rtools installation wizard, and it suggest a permissions problem.

This is the error when trying to isntall Rtools on her machine

C:\Users\Chris\Documents\R\Rtools\gcc-4.6.3

Error creating registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment

RegCreateKeyEx failed; code 5
Access is denied.

Click Retry to try again, Ignore to proceed anyway, or Abort to cancel
installation.

Any ideas? Do you think this is the solution: http://support.microsoft.com/kb/327507

@sachsmc
Copy link

sachsmc commented Dec 19, 2014

I believe this error occurs when Rtools tries to add gcc to the system-wide $PATH, which requires admin rights. My suggestion is to ignore to proceed anyway, and then modify the user $PATH later. You can access the user environment variables in Control Panel > Advanced System Settings > Advanced Tab > Environment Variables.

You'll want to add C:\Users\Chris\Documents\R\Rtools\gcc-4.6.3\bin to the path.

PS. you may get similar errors later on when other things need to be added to the path.
PPS. According to https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows, you need to add

C:\Users\Chris\Documents\R\Rtools\bin; C:\Users\Chris\Documents\R\Rtools\gcc-4.6.3\bin

To the beginning of the Path variable .

@hadley
Copy link

hadley commented Dec 20, 2014

Looks more like a registry access problem to me - I think it's better to get that working correctly, then rely on RStudio/devtools to set the path dynamically when needed. That's less likely to cause clashes with multiple installed tools.

Copy link

ghost commented Feb 16, 2015

Hi Sckott,

I also receive this error message when trying to install Rtools on my work machine. Did your friend manage to find a solution?

Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment