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
Percy2y ago
Project ID: ca9e8dc4-0fc3-403c-b07e-41cc02c47916
xylight
xylight2y ago
ca9e8dc4-0fc3-403c-b07e-41cc02c47916
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
xylight
xylight2y ago
Yes I am deploying from github, yes.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
xylight
xylight2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
xylight
xylight2y ago
i found a solution, dotenv allows you to fallback to System.getEnv() if there is no .env