RStudio - Error Starting R

I was editing some environmental variables within my .Renviron file and now I'm unable to start RStudio. I'm getting the following error. I've tried completely uninstalling and re-installing R and RStudio. I've also tried to purge as many config files related to both software before re-installing. Unfortunately, I'm still unable to launch RStudio. Any insight is appreciated!

The R session failed to start.

RECENT LOG:

ERROR Unable to retrieve user home path. HRESULT: -2147024893; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::core::system::userSettingsPath(const class rstudio::core::FilePath &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,bool) src/cpp/core/system/Win32System.cpp:338
2021-10-20T20:07:55.387600Z [rsession-A042474] ERROR Unable to retrieve user home path. HRESULT: -2147024893; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::core::system::userSettingsPath(const class rstudio::core::FilePath &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,bool) src/cpp/core/system/Win32System.cpp:338
2021-10-20T20:12:38.791545Z [rsession-A042474] ERROR Unable to retrieve user home path. HRESULT: -2147024893; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::core::system::userSettingsPath(const class rstudio::core::FilePath &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,bool) src/cpp/core/system/Win32System.cpp:338

Hi @philiporlando,
Welcome to the RStudio Community Forum.

Firstly, try running this command from an OS command line:
R --vanilla
This tries to load the basic R GUI, while ignoring any (and all) configuration files.
If R starts OK, then run: R.home() which shows you the R_HOME environmental variable. This must match any setting involving R_HOME in your configuration files.

If this doesn't help, hunt down and delete (or rename) all files on your system called: Rprofile.site, .Rprofile, or .Renviron which may contain incorrect variable definitions. R (and RStudio) should start correctly if none of these configuration files are present. Run help(Startup) for more info.

Still no luck? Did you install both R and RStudio in the default locations?

1 Like

Hello,

I was having the same issues with RStudio and found that it was a compatibility between my Windows 10 64-bit machine and the 64-bit version of R. I hit CTRL when I launched RStudio and selected the 32-bit version. This allowed me to open RStudio.

How I figured this out was trying to open R 64-bit locally and the window would auto-close. I did not have the same issue with the 32-bit version.

Does anyone know the difference between the 32-bit and 64-bit versions of R? Or should I be good to use the 32-bit version?

Good luck!

Bridget

This is exactly the same issue I'm having. The 32bit works fine but 64bit crashes as soon as its opened. My initial thought was compatibility, but then I installed R onto a Vanilla build with the same OS build and guess what?? it worked. So now im wondering if a prerequisite is missing from the device its not working on.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.