so right after I SSH into the deployed instance, I got below error
iex -S mix
** (Mix) You're trying to run :my_app on Elixir v1.9.4 but it has declared in its mix.exs file it supports only Elixir ~> 1.12
Render’s default elixir is 1.9 and my deployed app is running on 1.12 by specifying
ELIXIR_VERSION=1.12.1 in my environment variable.
But how can I spin up the ssh instance with the correct elixir version?
Just to clarify: You have a Render service that is successfully running with Elixir 1.12, but when you SSH into the instance it’s defaulting to Elixir 1.9?
Yes correct! The deployed app is successfully running elixir 1.12 but when I SSH into the instance I couldn’t bring up the console due to above error
I can confirm the same behavior. I have
ELIXIR_VERSION env var set to
1.13.3. You can check it on service
When using the Shell tab in the web UI:
When using ssh:
It looks like Render runs a command behind the scenes to detect the version when starting or connecting to your service from most contexts, but it doesn’t run when connecting via SSH. Can you try running:
ELIXIR_ENV_FILE=/home/render/elixir-env.sh; [ -f "$ELIXIR_ENV_FILE" ] && source "$ELIXIR_ENV_FILE"; after connecting?
I’ll share this with the team to see how we can support this without needing to run the command manually.
That worked, thanks.
ELIXIR_ENV_FILE=/home/render/elixir-env.sh; [ -f "$ELIXIR_ENV_FILE" ] && source "$ELIXIR_ENV_FILE";
# ==> Detected Erlang 24.2.1
# ==> Detected Elixir 1.13.3
~/project/src$ which iex
Yes this script worked - thanks! And yes it would be great if this can be done automatically rather than manually load every time.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.