I have a package that requires an environment variable to be set to install the package.
For eg - In a fresh new R session -
devtools::install_github("some_package")
gives an error
Object 'A' not found
If I set that environment variable and then install the package it works and installs the package succesfully.
Sys.setenv(A = 'some_value')
devtools::install_github("some_package")
This is ok to work locally. Now I have a quarto document that uses this package and when I am trying to deploy on Posit Connect it gives me an error in deploy logs.
Installing "some_package"
....
....
Object 'A' not found
I don't know how do I pass this environment variable at the time of deployment.
My failed attempts -
- I have tried setting the environment variable in Posit connect
- In
rsconnect::deployDoc
I saw a new argument calledenvVars
and I have tried
rsconnect::deployDoc("run_script.qmd", envVars = c(A = 'some_value'))
but this still gives me the same error.
Any ideas/suggestions?