Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phantom installation logic #89

Merged
merged 2 commits into from
Dec 13, 2019
Merged

Fix phantom installation logic #89

merged 2 commits into from
Dec 13, 2019

Conversation

wch
Copy link
Owner

@wch wch commented Dec 13, 2019

With install_phantomjs(force=TRUE), if calling phantomjs --version results in an error, then it would fail to install a new version of phantomjs. This fixes the logic so that if force is TRUE, then it won't check the old version.

@wch wch merged commit d206bd7 into master Dec 13, 2019
@wch wch deleted the fix-phantom-check branch December 13, 2019 20:57
@jaredlander
Copy link

Not sure this fully works. I successfully installed phantomjs using webshot::install_phantomjs() on both Windows and Ubuntu. But I tried installing it in Docker (from the r-ver image) after restoring an {renv} snapshot with the following commands.

RUN Rscript -e "renv::load('/home/${PROJ_NAME}')" -e "renv::restore(confirm=FALSE)" -e "install.packages('webshot')" -e "webshot::install_phantomjs()"

And that results in the following error.

tar (child): lbzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now
Error in webshot::install_phantomjs() : 
  Unable to install PhantomJS to any of these dirs: ~/bin, /root/.local/share/renv/cache/v4/R-3.6/x86_64-pc-linux-gnu/webshot/0.5.2/a9c10d391ebf2344939895cc6caca825/webshot/PhantomJS
In addition: Warning messages:
1: In utils::untar(zipfile) :
  ‘/bin/tar -xf 'phantomjs-2.1.1-linux-x86_64.tar.bz2'’ returned error code 2
2: In file.copy(exec, destdir, overwrite = TRUE) :
  problem copying phantomjs-2.1.1-linux-x86_64/bin/phantomjs to /root/bin/phantomjs: No such file or directory
3: In file.copy(exec, destdir, overwrite = TRUE) :
  problem copying phantomjs-2.1.1-linux-x86_64/bin/phantomjs to /root/.local/share/renv/cache/v4/R-3.6/x86_64-pc-linux-gnu/webshot/0.5.2/a9c10d391ebf2344939895cc6caca825/webshot/PhantomJS/phantomjs: No such file or directory
Execution halted

Looks like it's a file permission issue.

Yes, I know treating a folder in /home as a project folder probably is not ideal, but I don't think that's the problem.

@wch
Copy link
Owner Author

wch commented Jan 22, 2020

@jaredlander I think maybe the docker image needs to have bzip2?

@jaredlander
Copy link

@wch well what do you know, a simple fix I could have realized by more thoroughly reading the error. Thanks for pointing it out. Will now proceed to see if the whole setup works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants