alapo / Literate-Programming

This is the repository for the Literate Programming Workshop
39 stars 11 forks source link

Could not knit Word document in Mac #9

Closed shrushti-shah closed 3 years ago

shrushti-shah commented 3 years ago

Describe the bug Hi,

I am at the final step to knit the document in Rmarkdown in Mac OS X but a message saying "execution halted" keeps popping, the steps worked fine in Windows PC. I have R v4.0.2 and RStudio v1.4.1106.

Thankyou.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'manuscript.rmd'
  2. Click on 'Knit'
  3. Scroll down to 'Knit to rdocx-document'
  4. See error - Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Users/shrushtishah/systemfonts/libs/systemfonts.so': dlopen(/Users/shrushtishah/systemfonts/libs/systemfonts.so, 6): Symbol not found: _inflateValidate Referenced from: /Users/shrushtishah/systemfonts/libs/systemfonts.so (which was built for Mac OS X 10.13) Expected in: /usr/lib/libz.1.dylib in /Users/shrushtishah/systemfonts/libs/systemfonts.so Calls: ... asNamespace -> loadNamespace -> library.dynam -> dyn.load Execution halted

Expected behavior I tried to follow Andrew's instruction to remove certain symbols (check mark, book emoji etc.) from main RMD file but no success and same error occured again.

Screen Shot 2021-03-23 at 4 28 37 PM Screenshots Please see attached

devtools::session_info()

```r devtools::session_info() ─ Session info ────────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.0.2 (2020-06-22) os macOS Sierra 10.12.6 system x86_64, darwin17.0 ui RStudio language (EN) collate en_CA.UTF-8 ctype en_CA.UTF-8 tz America/Edmonton date 2021-03-23 ─ Packages ────────────────────────────────────────────────────────────────────────────────────────── ! package * version date lib source abind 1.4-5 2016-07-21 [1] CRAN (R 4.0.2) addinslist * 0.4.0 2021-01-10 [1] CRAN (R 4.0.2) arsenal * 3.6.2 2021-02-17 [1] CRAN (R 4.0.2) askpass 1.1 2019-01-13 [1] CRAN (R 4.0.2) assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2) backports 1.2.0 2020-11-02 [1] CRAN (R 4.0.2) bayestestR 0.8.2 2021-01-26 [1] CRAN (R 4.0.2) BiocManager 1.30.10 2019-11-16 [1] CRAN (R 4.0.2) broom 0.7.5 2021-02-19 [1] CRAN (R 4.0.2) bslib 0.2.4 2021-01-25 [1] CRAN (R 4.0.2) cachem 1.0.4 2021-02-13 [1] CRAN (R 4.0.2) callr 3.5.1 2020-10-13 [1] CRAN (R 4.0.2) car 3.0-10 2020-09-29 [1] CRAN (R 4.0.2) carData 3.0-4 2020-05-22 [1] CRAN (R 4.0.2) cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.2) cgwtools * 3.3 2021-01-06 [1] CRAN (R 4.0.2) cli 2.1.0 2020-10-12 [1] CRAN (R 4.0.2) colorspace 2.0-0 2020-11-11 [1] CRAN (R 4.0.2) colourpicker * 1.1.0 2020-09-14 [1] CRAN (R 4.0.2) crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.2) credentials 1.3.0 2020-07-21 [1] CRAN (R 4.0.2) curl 4.3 2019-12-02 [1] CRAN (R 4.0.1) data.table 1.13.2 2020-10-19 [1] CRAN (R 4.0.2) DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.2) dbplyr 2.0.0 2020-11-03 [1] CRAN (R 4.0.2) desc 1.3.0 2021-03-05 [1] CRAN (R 4.0.2) devtools 2.3.2 2020-09-18 [1] CRAN (R 4.0.2) digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.2) dplyr 1.0.2 2020-08-18 [1] CRAN (R 4.0.2) ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.2) esquisse * 0.3.1 2020-09-27 [1] CRAN (R 4.0.2) evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.1) fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.2) fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.2) forcats 0.5.0 2020-03-01 [1] CRAN (R 4.0.2) foreign 0.8-80 2020-05-24 [2] CRAN (R 4.0.2) formatR 1.8 2021-03-12 [1] CRAN (R 4.0.2) Formula * 1.2-4 2020-10-16 [1] CRAN (R 4.0.2) fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2) gargle 1.0.0 2021-03-03 [1] CRAN (R 4.0.2) generics 0.1.0 2020-10-31 [1] CRAN (R 4.0.2) V ggplot2 3.3.2 2020-12-30 [1] CRAN (R 4.0.2) ggThemeAssist * 0.1.5 2016-08-13 [1] CRAN (R 4.0.2) glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2) gmp 0.6-2 2021-01-07 [1] CRAN (R 4.0.2) googledrive 1.0.1 2020-05-05 [1] CRAN (R 4.0.2) googlesheets4 * 0.3.0 2021-03-04 [1] CRAN (R 4.0.2) gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.2) hablar * 0.3.0 2020-03-19 [1] CRAN (R 4.0.2) haven 2.3.1 2020-06-01 [1] CRAN (R 4.0.2) hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.2) htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2) htmlwidgets 1.5.2 2020-10-03 [1] CRAN (R 4.0.2) httpuv 1.5.5 2021-01-13 [1] CRAN (R 4.0.2) httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2) insight 0.13.1 2021-02-22 [1] CRAN (R 4.0.2) janitor 2.1.0 2021-01-05 [1] CRAN (R 4.0.2) jquerylib 0.1.3 2020-12-17 [1] CRAN (R 4.0.2) jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.0.2) jtools * 2.1.3 2021-03-12 [1] CRAN (R 4.0.2) knitr 1.31 2021-01-27 [1] CRAN (R 4.0.2) later 1.1.0.1 2020-06-05 [1] CRAN (R 4.0.2) lattice * 0.20-41 2020-04-02 [2] CRAN (R 4.0.2) lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.2) lubridate 1.7.9.2 2020-11-13 [1] CRAN (R 4.0.2) V magrittr 1.5 2020-11-17 [1] CRAN (R 4.0.2) MASS 7.3-53 2020-09-09 [2] CRAN (R 4.0.2) Matrix 1.2-18 2019-11-27 [2] CRAN (R 4.0.2) memoise 2.0.0 2021-01-26 [1] CRAN (R 4.0.2) mime 0.10 2021-02-13 [1] CRAN (R 4.0.2) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.0.2) modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.2) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.2) officer * 0.3.17 2021-03-05 [1] CRAN (R 4.0.2) openssl 1.4.3 2020-09-18 [1] CRAN (R 4.0.2) openxlsx 4.2.3 2020-10-27 [1] CRAN (R 4.0.2) pacman 0.5.1 2019-03-11 [1] CRAN (R 4.0.2) pander 0.6.3 2018-11-06 [1] CRAN (R 4.0.2) pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2) pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2) pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.2) plyr * 1.8.6 2020-03-03 [1] CRAN (R 4.0.2) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2) processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.2) promises 1.1.1 2020-06-09 [1] CRAN (R 4.0.2) ps 1.4.0 2020-10-07 [1] CRAN (R 4.0.2) purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.2) R6 2.5.0 2020-10-28 [1] CRAN (R 4.0.2) V Rcpp 1.0.5 2021-01-15 [1] CRAN (R 4.0.2) readr 1.4.0 2020-10-05 [1] CRAN (R 4.0.2) readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.2) remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2) reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.2) rio * 0.5.26 2021-03-01 [1] CRAN (R 4.0.2) rlang 0.4.10 2020-12-30 [1] CRAN (R 4.0.2) rmarkdown 2.7 2021-02-19 [1] CRAN (R 4.0.2) Rmisc * 1.5 2013-10-22 [1] CRAN (R 4.0.2) rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.0.2) rstatix 0.7.0 2021-02-13 [1] CRAN (R 4.0.2) rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.2) rvest 0.3.6 2020-07-25 [1] CRAN (R 4.0.2) sass 0.3.1 2021-01-24 [1] CRAN (R 4.0.2) scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.2) sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2) shiny 1.6.0 2021-01-25 [1] CRAN (R 4.0.2) shinyWidgets 0.6.0 2021-03-15 [1] CRAN (R 4.0.2) sjlabelled 1.1.7 2020-09-24 [1] CRAN (R 4.0.2) sjmisc 2.8.6 2021-01-07 [1] CRAN (R 4.0.2) snakecase 0.11.0 2019-05-25 [1] CRAN (R 4.0.2) stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.2) stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.2) survival * 3.2-7 2020-09-28 [2] CRAN (R 4.0.2) sys 3.4 2020-07-23 [1] CRAN (R 4.0.2) testthat 3.0.0 2020-10-31 [1] CRAN (R 4.0.2) tibble 3.0.4 2020-10-12 [1] CRAN (R 4.0.2) tidyr 1.1.2 2020-08-27 [1] CRAN (R 4.0.2) tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.2) tidyverse 1.3.0 2019-11-21 [1] CRAN (R 4.0.2) V tinytex 0.27 2021-03-04 [1] CRAN (R 4.0.2) usethis 1.6.3 2020-09-17 [1] CRAN (R 4.0.2) uuid 0.1-4 2020-02-26 [1] CRAN (R 4.0.2) vctrs 0.3.4 2020-08-29 [1] CRAN (R 4.0.2) withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.2) V xfun 0.19 2021-03-11 [1] CRAN (R 4.0.2) xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.2) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.0.2) yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.2) zip 2.1.1 2020-08-27 [1] CRAN (R 4.0.2) [1] /Users/shrushtishah [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library V ── Loaded and on-disk version mismatch. ```

alapo commented 3 years ago

Great job troubleshooting! But don't forget to highlight code bits as I showed in the last workshop.

After trying each of these solutions try knitting your document

Solution 1

From my quick Google searches this seems to be a very common problem with older versions of OSX (see here and here) which seems to be mitigated by installing XQuartz.

I would recommend trying to install it and then re-starting your computer. If it is possible you could also consider upgrading your version of OSX.

First step Install XQuartz

Second step install.packages("systemfonts", dependencies = TRUE)

Solution 2

First step

Second step install.packages("Rcpp", type = 'source')

Solution 3

If these steps are overwhelming you can also consider completely uninstalling R and RStudio and re-starting this process. The error seems to be associated with an improper installation. I found a guide for those using OSX that is better than the one I showed in our YouTube videos which you can view here

Solution 4

If neither of these Solutions get this fixed, don't worry we are not giving up. Email me with some available times and I will have a zoom session with you to troubleshoot until we get it working.

I found a few posts which may help you

Post 1 Post 2 Post 3 Post4 - Install XQuartz fixed the issue

shrushti-shah commented 3 years ago

Thanks so much Andrew, quick update because I saw someone else is having the same issue - I tried installing Rbuild tools in following steps using https://ohdsi.github.io/Hades/rSetup.html#Instructions_for_Mac:

1) Installed latest versions of XCode, gfortran and XQuartz. (took BIG chunk of space and time! :D) 2) Confirmed installation of each in Terminal (please see attached screenshot) 3) Verified all the steps using the code "pkgbuilder" to check all build tools are installed.

Screen Shot 2021-03-24 at 6 10 28 PM

Just realized that error is with my Mac OS version, I have High Sierra 10.12.6 and the code provided is for 10.13 or higher versions. I am hopeful that the steps should work once I update the OS X - will do on weekend as it might take time OR find an alternative code for Mac OSX 10.12.

Screen Shot 2021-03-23 at 4 28 37 PM

The posts were a great help! Thank you for that as well.

alapo commented 3 years ago

Do you have time to hop on Zoom in the next 15min or so? If so, shoot me an email please I'll send you the zoom info

alapo commented 3 years ago

Issue was related to an outdated version of OSX. R v4.0.4 requires Mac OS X High Sierra v13.0 or higher (mine is High Sierra v10.12.6).

Update the "requirements" section of the installation module to add this warning in future workshops.