You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using rocker/verse in my docker file and when I try to load pins, it gives me the same error from #705
Error: package or namespace load failed for ‘pins’:
.onLoad failed in loadNamespace() for 'pins', details:
call: NULL
error: [ENOENT] Failed to make directory '//.cache/pins': no such file or directory
Execution halted
I looked further and believe the error is from this function:
board_cache_path <- function(name) {
# R_CONFIG_ACTIVE suggests we're in a production environment
if (has_envvars("R_CONFIG_ACTIVE") || has_envvars("PINS_USE_CACHE")) {
path <- fs::dir_create(tempdir(), "pins")
} else if (has_envvars("PINS_CACHE_DIR") ) {
path <- Sys.getenv("PINS_CACHE_DIR")
} else {
path <- cache_dir()
}
fs::path(path, name)
}
I guess rocker doesnt set R_CONFIG_ACTIVE so pins doesnt know it's in a production environment? In any case, setting R_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 #705 gives the error when deployed .
The text was updated successfully, but these errors were encountered:
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:
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 #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 #705 gives the error when deployed .
The text was updated successfully, but these errors were encountered: