Closed chabrault closed 2 months ago
@juliendiot42 Can you look into this? Maybe the doc should mention this variable PLANTBREEDGAME_DATA_ROOT
?
Thank you very much.
Indeed I recently added this environment variable to let user choose the location they want for the game data. However, there is no default value.
I don't know how to set environment variable on windows though.
On linux or mac it would be with (from a terminal):
export PLANTBREEDGAME_DATA_ROOT="<path/to/the/game/data>" # set this environment variable
Rscript --vanilla -e "shiny::runApp(port = as.numeric(Sys.getenv('TEST_PORT')))" # launch the app
However, when R starts, it reads a ".Renviron" file in which we can specify such environment variable (for R only). You could add this variable there with:
PLANTBREEDGAME_DATA_ROOT="./data"
I think on windows this file is located at: c:\Users\<user-name>\Documents\.Renviron
To fix that, I will add a default value to use in case the environment variable does not exist.
I didn't have a .Renviron file initially, I created it in the default location (C:\Users\<user-name>\Documents\.Renviron
). Then, I pasted your command but it didn't work when I run the game from shiny::runApp()
. I changed the path to the actual data
folder but it still didn't work.
But everything works fine using Docker!
Hi,
When I tried to launch the app, I got the following error:
Error in ..stacktraceon..({ : Specified game data folder: does not exist. Make sure the
PLANTBREEDGAME_DATA_ROOTenvironment variable is correctly set
The error arises from
global.R
, line 50. I pasted the output formSys.getenv
:When I manually set
DATA_ROOT
variable, it worked.