NOAA-EDAB / tech-doc

Technical documentation for ecosystem reporting
https://noaa-edab.github.io/tech-doc
Other
8 stars 9 forks source link

cloning tech-doc to local machine appears to break lots of things, but don't panic #81

Closed sgaichas closed 1 month ago

sgaichas commented 1 year ago

@andybeet and I have both tried over different networks and with different versions of R. (@kimberly-bastille )

Seems to be related to the renv package, diagnosing now

this is the error message upon opening

# Bootstrapping renv 0.14.0 --------------------------------------------------
* Downloading renv 0.14.0 ... OK
* Installing renv 0.14.0 ... Done!
* Successfully installed and loaded renv 0.14.0.
* Project '~/Documents/0_Data/ESR/SOE2023/tech-doc' loaded. [renv 0.14.0]
Warning message:
Project requested R version '4.1.2' but '4.0.4' is currently being used 
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
WARNING: Your CRAN mirror is set to "http://cran.rstudio.com" which has an insecure (non-HTTPS) URL. The repository was likely specified in .Rprofile or Rprofile.site so if you wish to change it you may need to edit one of those files. You should either switch to a repository that supports HTTPS or change your RStudio options to not require HTTPS downloads.

To learn more and/or disable this warning message see the "Use secure download method for HTTP" option in Tools -> Global Options -> Packages.
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
* The project library is out of sync with the lockfile.
* Use `renv::restore()` to install packages recorded in the lockfile.
sgaichas commented 1 year ago

attempting renv::restore() right now

sgaichas commented 1 year ago

Update: @kimberly-bastille ran restore and it worked. I ran restore and it errored out due to a missing component on my local machine. Either way this may not matter to editing tech doc as long as we don't build it locally.

@andybeet I'm trying a fix to a tech doc page without having any of the packages installed to see if it builds online

could be hours before we know.... tech doc build is long!

sgaichas commented 1 year ago

so I pushed a change to the Single Species Status Indicator .Rmd without key packages loaded in the project library (R studio prompted me to install DT but I didn't), and the tech-doc build worked fine: https://noaa-edab.github.io/tech-doc/stockstatus.html#stockstatus

this seems to confirm that as long as we are not building locally, we can ignore errors and warnings from renv and proceed with editing?

the only caveat is I did install rmarkdown (and dependencies) into the project library prior to making this change, but I think that should not matter?

kimberly-bastille commented 1 year ago

@sgaichas Agreed. Having Rmarkdown installed or not will have no impact on the github actions build. So editing chapters and pushing either to main or as a pull request will work. An issue will only occur if you try to build locally.