在新创建的应用中运行mix deps.get
时,出现以下错误。当我运行mix hex.info
时,在信息后出现相同的错误:
C:\Dev\Test\elixir_scenic\scenic-master\scenic_example>mix hex.info
Hex: 0.19.0
Elixir: 1.8.1
OTP: 21.3
Built with: Elixir 1.8.0 and OTP 20.2
Error opening ETS file h:/.hex/cache.ets: {:read_error, {:file_error, 'h:/.hex/cache.ets', :eio}}
....
我在Windows 10上。我还尝试过以管理员身份运行mix
命令:同样的问题。这是完整的错误日志:
Error opening ETS file h:/.hex/cache.ets: {:read_error, {:file_error, 'h:/.hex/cache.ets', :eio}}
Resolving Hex dependencies...
Dependency resolution completed:
New:
[32m elixir_make 0.5.2[0m
[32m font_metrics 0.3.1[0m
[32m msgpax 2.2.3[0m
[32m scenic 0.10.2[0m
[32m scenic_clock 0.10.0[0m
[32m scenic_driver_glfw 0.10.0[0m
[32m scenic_sensor 0.7.0[0m
* Getting scenic (Hex package)
* Getting scenic_driver_glfw (Hex package)
* Getting scenic_sensor (Hex package)
* Getting scenic_clock (Hex package)
* Getting elixir_make (Hex package)
* Getting font_metrics (Hex package)
* Getting msgpax (Hex package)
20:41:46.292 [error] GenServer Hex.Registry.Server terminating
** (MatchError) no match of right hand side value: {:error, :eaccess}
(hex) lib/hex/registry/server.ex:273: Hex.Registry.Server.persist/2
(hex) lib/hex/registry/server.ex:142: anonymous fn/3 in Hex.Registry.Server.handle_call/3
(hex) lib/hex/registry/server.ex:436: Hex.Registry.Server.wait_closing/2
(hex) lib/hex/registry/server.ex:140: Hex.Registry.Server.handle_call/3
(stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
(stdlib) gen_server.erl:690: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.91.0>): :close
State: %{closing_fun: nil, ets: #Reference<0.3859258191.2784886792.168350>, fetched: #MapSet<[{"hexpm", "elixir_make"}, {"hexpm", "font_metrics"}, {"hexpm", "msgpax"}, {"hexpm", "plug"}, {"hexpm", "scenic"}, {"hexpm", "scenic_clock"}, {"hexpm", "scenic_driver_glfw"}, {"hexpm", "scenic_sensor"}]>, path: "h:/.hex/cache.ets", pending: #MapSet<[]>, waiting: %{}}
Client #PID<0.91.0> is alive
(stdlib) gen.erl:169: :gen.do_call/4
(elixir) lib/gen_server.ex:986: GenServer.call/3
(hex) lib/hex/registry/server.ex:37: Hex.Registry.Server.close/0
(mix) lib/mix/dep/converger.ex:52: Mix.Dep.Converger.converge/4
(mix) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3
(mix) lib/mix/tasks/deps.get.ex:31: Mix.Tasks.Deps.Get.run/1
(mix) lib/mix/task.ex:331: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
** (ArgumentError) raise/1 and reraise/2 expect a module name, string or exception as the first argument, got: {:badmatch, {:error, :eaccess}}
(hex) lib/hex/registry/server.ex:273: Hex.Registry.Server.persist/2
(hex) lib/hex/registry/server.ex:142: anonymous fn/3 in Hex.Registry.Server.handle_call/3
(hex) lib/hex/registry/server.ex:436: Hex.Registry.Server.wait_closing/2
(hex) lib/hex/registry/server.ex:140: Hex.Registry.Server.handle_call/3
(stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
(stdlib) gen_server.erl:690: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
答案 0 :(得分:0)
在Elixir forum中,我得到了hint,Elixir的程序包管理器“ hex”正在使用用户主目录(由环境变量public async Task<int> DoStuff(int entityId)
{
//Not Critical Stuff
//Critical Stuff
ReadObjectFromRedis();
ManipulateObject();
UpdateSqlDatabase();
SaveObjectToRedis();
//Not Critical Stuff
}
和HOMEDRIVE
指定)用于存储软件包等。由于我的主目录在公司网络外部无法完全使用,因此软件包管理器遇到了问题。将HOMEPATH
文件夹移至其他驱动器并在环境变量.hex
中指定新位置即可解决此问题。