I could reproduce your twitteR issue, and fix it by following the advice already in this message thread.
The short version:
Environment:
Now if I query for the environment variables:
PATH should have included "c:\Program Files\r\R-3.2.0\bin\i386", but it is missing. R.NET would have appended it. Don't know/understand why IIS does that, whatever. R_HOME has been set correctly by R.NET (and the path format for R_HOME is deliberate)
To fix it it seems I then need to:
The short version:
- By default do not set a R_HOME in the machine environment variable.
- Add c:\Program Files\r\R-3.2.0\bin\i386 to the machine or user's PATH env variable (or \x64 if your IIS server runs 64 bits, see details)
- I advise you look at the solution in rdotnet-onboarding, under folder Solutions/WebApp. Credits: this material was contributed by @skyguy94
-
Install the NuGet packages (there are quite a few - couple of minutes)
Environment:
- Win7 64 bits
- R 3.2.0
- VS2013
-
IIS Express, don't know the version
CodeController.Execute
and its constructor, in the app of the onboarding guidelibrary(twitteR)
and using the "immediate" debug window on breakpointsEnvironment.Is64BitProcess
false
Curious, as I am running a 64 bits operating system and the build is AnyCPU. Whatever, 32 bits it is.Now if I query for the environment variables:
Environment.GetEnvironmentVariable("PATH")
"c:\\Yadi\\Yada\\Lots\\of\paths;F:\\bin\\doxygen\\bin"
Environment.GetEnvironmentVariable("R_HOME")
"C:/PROGRA~1/R/R-32~1.0"
The call to Evaluate
fails indeed.PATH should have included "c:\Program Files\r\R-3.2.0\bin\i386", but it is missing. R.NET would have appended it. Don't know/understand why IIS does that, whatever. R_HOME has been set correctly by R.NET (and the path format for R_HOME is deliberate)
To fix it it seems I then need to:
- kill IIS Express
- Add c:\Program Files\r\R-3.2.0\bin\i386 to the Machine or user's PATH env ver
-
AND restart VS2013 (Huh?)
to get a fully clean slate.
Environment.GetEnvironmentVariable("PATH")
"c:\\Yadi\\Yada\\Lots\\of\paths;F:\\bin\\doxygen\\bin;c:\\Program Files\\r\\R-3.2.0\\bin\\i386"
Environment.GetEnvironmentVariable("R_HOME")
"C:/PROGRA~1/R/R-32~1.0"
Then things work:library(twitteR)
tuser <- getUser('geoffjentry')
I have not set up OAuth so I get an error of course, but the package seems to work fine.