Closed ncullen93 closed 1 year ago
Yes, it's true that the default mode for pins is set up for interactive work, and to use pins in an environment that is very limited in permissions or even read only, you need to set an environment variable to control the cache path. You can set R_CONFIG_ACTIVE
like you found, or we document/recommend setting one of the environment variables that control where the pins cache is. For example from R, before loading the pins library, you could do something like:
Sys.setenv(PINS_CACHE_DIR = base::tempdir())
Sys.getenv("PINS_CACHE_DIR")
#> [1] "/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T//RtmpIFoEAQ"
Created on 2023-11-20 with reprex v2.0.2
Then you'd just have a per-session cache that writes to the temp directory only.
Thanks!!
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
I am using
rocker/verse
in my docker file and when I try to load pins, it gives me the same error from https://github.com/rstudio/pins-r/issues/705I looked further and believe the error is from this function:
I guess rocker doesnt set
R_CONFIG_ACTIVE
so pins doesnt know it's in a production environment? In any case, settingR_CONFIG_ACTIVE
as an environment variable in my heroku app makes the error go away.Hard to make a reprex but basically the same reprex suggested in https://github.com/rstudio/pins-r/issues/705 gives the error when deployed .