Mix phx.gen.cert error

I’m seeing an issue when trying to run mix phx.gen.cert:

(UndefinedFunctionError) function :public_key.generate_key/1 is undefined (module :public_key is not available)

I compiled Erlang and Elixir from source. The :public_key module is definitely available — I can use it in iex. For whatever reason Mix can’t seem to find it.

I ran into other issues with my setup and ended up having to downgrade OTP to an older version. That doesn’t seem to fix this issue, but I wonder if downgrading further will resolve it.

Has anyone else run into this?

Are you sure those run based on the same install? Which versions of otp/elixir/phoenix are you trying to use?