Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku**(ErlangError)上的Elixir应用程序erlang错误::";“未导出函数”;_Heroku_Elixir_Phoenix Framework - Fatal编程技术网

Heroku**(ErlangError)上的Elixir应用程序erlang错误::";“未导出函数”;

Heroku**(ErlangError)上的Elixir应用程序erlang错误::";“未导出函数”;,heroku,elixir,phoenix-framework,Heroku,Elixir,Phoenix Framework,我对部署在heroku上的phoenix应用程序有问题。当我在本地运行这段代码时,一切正常,没有错误。部署到heroku时,应用程序成功部署并启动,但使用应用程序GenServer时,进程崩溃,出现以下错误: [error] GenServer :main_worker terminating ** (exit) an exception was raised: ** (ErlangError) erlang error: :"function not exported" (

我对部署在heroku上的phoenix应用程序有问题。当我在本地运行这段代码时,一切正常,没有错误。部署到heroku时,应用程序成功部署并启动,但使用应用程序GenServer时,进程崩溃,出现以下错误:

[error] GenServer :main_worker terminating
** (exit) an exception was raised:
   ** (ErlangError) erlang error: :"function not exported"
       (elixir) Map.get_and_update!(%{"location" => %{"latitude" => 35.9628632, "longitude" => -86.8216522}, "name" => "Dover", "pickups" => 0}, "pickups", #Function<0.62518121/1 in BusTracker.MainWorker.handle_call/3>)
       (bus_tracker) lib/bus_tracker/main_worker.ex:27: BusTracker.MainWorker.handle_call/3
       (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4
       (stdlib) gen_server.erl:661: :gen_server.handle_msg/5
       (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
13:25:03.112 [error] GenServer #PID<0.319.0> terminating
** (exit) an exception was raised:
   ** (ErlangError) erlang error: {{:undef, [{Map, :get_and_update!, [%{"location" => %{"latitude" => 35.9628632, "longitude" => -86.8216522}, "name" => "Dover", "pickups" => 0}, "pickups", #Function<0.62518121/1 in BusTracker.MainWorker.handle_call/3>], []}, {BusTracker.MainWorker, :handle_call, 3, [file: 'lib/bus_tracker/main_worker.ex', line: 27]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 629]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 661]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}, {GenServer, :call, [:main_worker, {:update_pickups, {"Dover", 1}}, 5000]}}
       (elixir) lib/gen_server.ex:356: GenServer.call/3
       (bus_tracker) web/channels/main_channel.ex:38: BusTracker.MainChannel.handle_in/3
       (phoenix) lib/phoenix/channel/server.ex:210: Phoenix.Channel.Server.handle_info/2
       (stdlib) gen_server.erl:615: :gen_server.try_dispatch/4
       (stdlib) gen_server.erl:681: :gen_server.handle_msg/5
       (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
我正在使用这些heroku构建包:

  • github.com/HashNuke/heroku-buildpack-elixir.git
  • github.com/gjaldon/heroku-buildpack-phoenix-static.git
这是我的elixir_buildpack.config:

# Erlang version
erlang_version=18.1.3

# Elixir version
elixir_version=1.0.4

# Always rebuild from scratch on every deploy?
always_rebuild=false

# Export heroku config vars
# config_vars_to_export=(DATABASE_URL)

# A command to run right after compiling the app
post_compile="pwd"

上的elixir irc频道中提到了这一点,但在讨论中,我想不出如何解决这个问题。我是长生不老药/二郎新手,有人能给我一些帮助吗?谢谢

请确保您在Heroku上使用的Elixir和Erlang版本与您在开发环境中使用的版本相同

# Erlang version
erlang_version=18.1.3

# Elixir version
elixir_version=1.1.1

您在本地运行的Elixir和Erlang版本是否与您在构建包中定义的版本相同?哇,完全是新手的错误。事实上,版本是不同的,所以我在构建包中更新到Elixir1.1.1,问题就消失了。谢谢@Gazler!如果可以,你应该将Gazler的回答标记为“接受”。
# Erlang version
erlang_version=18.1.3

# Elixir version
elixir_version=1.1.1