1

I am using RSelenium and want to set a Firefox profile. So I tried to reproduce the example of the answer to this question. However, no matter what I change I always get the following error. What am I doing wrong?

I already read in the RSelenium manual that for windows systems RTools should be installed when one wants to make a Firefox profile. I did but nothing changed.

The error is the following:

Error in file(tmpfile, "rb") : cannot open the connection
In addition: Warning messages:
1: running command '"zip" -r9Xjq "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip" "C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl/firefoxprofile/prefs.js" ' had status 127 
2: In file(tmpfile, "rb") :
  cannot open file 'C:\Users\mariu\AppData\Local\Temp\RtmpQfl3bl\file15c41fc2411d.zip': No such file or directory
Community
  • 1
  • 1
stats_guy
  • 695
  • 1
  • 9
  • 26

2 Answers2

5

the problem is that Rselenium cannot create a zip file of your Firefox Profile (error status 127), therefore cannot read it in the next command line.

I resolved following this answer: Create zip file: error running command " " had status 127 .

Do as the link says , shut down R, restart your pc and it should work.

Thanks, Rob

Community
  • 1
  • 1
GrilloRob
  • 262
  • 1
  • 3
  • 15
0

Sometimes, for some reasons, it is not enough to add Rtools file location to Environmental Variables as was mentioned here. To solve the problem you need to add path within R using folowing code:

writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

Then PC needs to be reseted. After that you can check whether path was setted correctly.

Sys.which("make")
## "C:\\rtools40\\usr\\bin\\make.exe

If output of sys.which is "" then something went wrong. By the way the entire procedure has been described here: https://cran.r-project.org/bin/windows/Rtools/.

jeparoff
  • 166
  • 8