rstudio / renv

renv: Project environments for R.
https://rstudio.github.io/renv/
MIT License
1k stars 152 forks source link

Error in writef(e$output) : could not find function "writef" #395

Closed alandipert closed 4 years ago

alandipert commented 4 years ago

System: renv version: 0.9.2-37 as (I think?) installed automatically by RStudio Server Pro 1.2.5019-6 with R 3.6.2

How I saw it:

  1. clone https://github.com/CRI-iAtlas/shiny-iatlas at 6c9427b38d65af708e5f1f5434abc59eb375ecfc
  2. Open in RStudio
  3. In the RStudio console, run renv::restore()

Observed the following error:

Installing RPostgres [1.2.0] ...
    FAILED
Error in writef(e$output) : could not find function "writef"

I suspect the reasons RPostgres failed are particular to my system, so I'm not confident this is enough information to reproduce. Perhaps the failure could be reproduced by simulating an install failure somehow.

A quick grep of renv master pointed me at https://github.com/rstudio/renv/blob/c3d726851a8fa5d7c116536ebb27ce260ffb55c0/R/install.R#L239 which looks like it could be the source of the error.

Thanks in advance for looking into it 🙏

kevinushey commented 4 years ago

Can you update to the latest version of renv? This should already be fixed.

kevinushey commented 4 years ago

Note that the version of renv is set explicitly by the project, so that project needs to update the version of renv associated.

alandipert commented 4 years ago

Thanks 👍

I resolved by running renv::install("renv") and then restarting R. Then I ran renv::restore() and saw the error message that was previously suppressed.

kevinushey commented 4 years ago

Great! Hopefully getting to the bottom of the package installation issue was not too arduous.