Pagedown: Error to install pagedown on Rstudio Cloud with websocket

Created on 9 Feb 2019  Â·  5Comments  Â·  Source: rstudio/pagedown

I am trying to install pagedown on Rstudio Cloud and I get the following error:

Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
ERROR: dependency ‘websocket’ is not available for package ‘pagedown’

  • removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/pagedown’
    installation of package ‘/tmp/RtmpsjhrAU/filec31a8a761f/pagedown_0.1.4.tar.gz’ had non-zero exit status

so I tried to install
remotes::install_github('rstudio/websocket')
and I got the following error:

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
make: * [websocket.o] Error 4
ERROR: compilation failed for package ‘websocket’

  • removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/websocket’

What I should do to fix it, considering that I am working on Rstudio Cloud?

Most helpful comment

IMO the use of a httpuv server+a browser as a websocket client shouldn't be too difficult.

All 5 comments

the solution is to install in Rstudio cloud Pagedown from Cran and not from github

@RLesur Given that we don't know when the websocket package will be released to CRAN, I wonder how difficult it would be to switch to httpuv instead. I know you have already experimented with it: https://gist.github.com/RLesur/522e0e7e7b75826e2c9d35bdfcaa1a89

IMO the use of a httpuv server+a browser as a websocket client shouldn't be too difficult.

Just to let you know that I began working on this. It is working but

  • httpuv server needs a browser opened to run
  • I do not manage to make it work with chrome headless so it open a chrome browser not headless to be able to apply the workflow.

basically, I used httpuv to make a websocket tunnel to chrome. The code has not change very much

R <-> httpuv server in a chrome browser <-> chrome headless with devtool protocol.

=> Working: https://github.com/cderv/pagedown/tree/no-websocket-package
=> Not working yet: https://github.com/cderv/pagedown/tree/no-websocket-package-headless

For next discussion, I'll open a proper issue and share with a working PR. (unless you want me to share WIP PR)

To run:

  1. Fetch the branch
  2. devtools::load_all(".")
  3. pagedown::chrome_print('https://pagedown.rbind.io/', verbose = TRUE)
Was this page helpful?
0 / 5 - 0 ratings