Railway not using dotenv properly

I have a Kotlin/java bot. It uses a library called dotenv to get environment variables from a file. However, when deploying to railway with the environment variables set in settings, I get errors saying "/.env does not exist." Any ideas?
8 Replies
Percy
Percy3y ago
Project ID: ca9e8dc4-0fc3-403c-b07e-41cc02c47916
xylight
xylightOP3y ago
ca9e8dc4-0fc3-403c-b07e-41cc02c47916
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
xylight
xylightOP3y ago
Yes I am deploying from github, yes.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
xylight
xylightOP3y ago
Is there a way to make railway build a .env from my .env.example I was using those, but dotenv needs a .env file.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
xylight
xylightOP3y ago
i found a solution, dotenv allows you to fallback to System.getEnv() if there is no .env
Want results from more Discord servers?
Add your server