Closed tatjana-lebesgue closed 11 months ago
Could you tell us more about your project and how you are attempting to deploy?
I just tried the following steps and the .env
file was selected when deploying:
# create a new project
usethis::create_project("~/Desktop/using-env")
# within this project, create a skeleton shiny app
# and an .env file.
writeLines(c(
"shinyApp(ui = fluidPage('having an environment.'), server = function(input, output){})"
), "app.R")
writeLines(c(
"# the .env file"
), ".env")
I then used the "publish" icon:
I am using same way to deploy app on shiny server, selecting files from rstudio and clicking on publish icon:
My ui is dashboardPage with a lot of elements I dont know which details are important. But I know that when I try to deploy using rsconnect version 0.8.29 I can see my .env file (but cant deploy)
@tatjana-lebesgue I have somehow managed to get one of my projects into the same state. I'm continuing to dig. I'm not sure the cause nor a workaround at this point.
With rsconnect-0.8.29:
> rsconnect::listBundleFiles(getwd())$contents
[1] ".env" "app.R"
With rsconnect-1.0.2:
> rsconnect::listBundleFiles(getwd())$contents
[1] "app.R"
The .env
directory is now regarded as a well-known path for Python virtual environments:
This was done in https://github.com/rstudio/rsconnect/pull/700
@tatjana-lebesgue - is it possible to rename that .env
file, perhaps to .Renviron
? Are you using other tools which expect the .env
filename?
I'm continuing to see if we can allow .env
files again, but in the mean time, using some other name should let you deploy again.
I did that, and now it's working! I was using the 'dotenv' package and then was expecting the '.env' filename (regards consistency in other projects).
Thank you for the quick response and help @aronatkins :)
@tatjana-lebesgue The development version of rsconnect should let you use .env
files once again.
remotes::install_github("rstudio/rsconnect")
Please let us know if you encounter any other difficulties.
I could not deploy my app on shiny server: