rbookdowngitbook

bookdown-demo Can Build pdf and epub, but have error with gitbook creation


I am trying to create the HTML output in gitbook format for the demo Bookdown files. When I go to build I receive the following error:

  1. I am using RStudio Version 1.1.463, r Version 3.5.3, and MiKTeX Version 2.9
  2. I have no problems creating the pdf or epub versions of the demo book
  3. My Workspace is on a separate logical drive, D:\R-Work\bookdown-demo-master, as I don't want any of my work saved in the mapped network documents folder.
  4. My r library files are located in \\DRIFTWOODDC\Student\steven.taylor\My Documents\R\win-library\3.5

My _output.yml file has not been changed from the originally downloaded version:

bookdown::gitbook:
  css: style.css
  config:
    toc:
      before: |
        <li><a href="./">A Minimal Book Example</a></li>
      after: |
        <li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
    edit: https://github.com/rstudio/bookdown-demo/edit/master/%s
    download: ["pdf", "epub"]
bookdown::pdf_book:
  includes:
    in_header: preamble.tex
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes
bookdown::epub_book: default

I am expecting RStudio to create the html files for the gitbook output, but none are created and I receive the following error:

==> rmarkdown::render_site(output_format = 'bookdown::gitbook', encoding = 'UTF-8')

Error in system.file(..., package = "bookdown", mustWork = TRUE) : 
  no file found
Calls: <Anonymous> ... do.call -> <Anonymous> -> bookdown_file -> system.file
Execution halted

Exited with status 1.

I have the same symptoms and issues if I try to create the bookdown-crc template files in gitbook format. I can create the pdf and epub, but not the html output.


Solution

  • I performed the following actions to troubleshoot:

    1. Uninstall and Reinstall R and R Studio both to new logical drive instead of default location.
    2. Changed the R_USER_LIBS environment variable to where I wanted the library files to be installed on the new logical drive. I installed all extra libraries via to command line instead of letting the libraries auto-install when they were missing during the build process.

    It seems that there is an issue using networked drives for the R Libraries. By default on my Windows work computer the R Libraries were put into the "My Documents" folder.

    Second successful method was to install RPortable and RStudioPortable on a USB Drive and use the portable version to generate the bookdown::gitbook.