Skip to content

Commit 032bedb

Browse files
Pedro Piñera Buendíaclaude
authored andcommitted
fix: Include Elixir lib in ERL_LIBS for remote peer
The remote peer needs Elixir's lib dir in ERL_LIBS so that application:ensure_all_started can find elixir.app, logger.app, etc. when starting deps like req_llm. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2326361 commit 032bedb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/terrarium/runtime.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,10 @@ defmodule Terrarium.Runtime do
260260
"#{runtime.elixir_lib}/*/ebin"
261261
]
262262

263-
# Set ERL_LIBS so :code.lib_dir/1 and Application.app_dir/1 resolve correctly
264-
env = Map.put(Keyword.get(opts, :env, %{}), "ERL_LIBS", dest)
263+
# Set ERL_LIBS so :code.lib_dir/1 and Application.app_dir/1 resolve correctly.
264+
# Include both the deploy dest (app code) and Elixir's lib dir (elixir, logger, etc.)
265+
erl_libs = "#{dest}:#{runtime.elixir_lib}"
266+
env = Map.put(Keyword.get(opts, :env, %{}), "ERL_LIBS", erl_libs)
265267

266268
peer_opts =
267269
opts

0 commit comments

Comments
 (0)