2
** (UndefinedFunctionError) function :ssl.cipher_suites/0 is undefined or private, use cipher_suites/2,3 instead
    (ssl 10.4.1) :ssl.cipher_suites()
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_ssl.erl:77: :hackney_ssl.ciphers/0
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_ssl.erl:69: :hackney_ssl.connect/4
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_connect.erl:277: :hackney_connect.do_connect/5
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_connect.erl:47: :hackney_connect.connect/5
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney.erl:333: :hackney.request/5
    (httpoison 1.8.0) lib/httpoison/base.ex:846: HTTPoison.Base.request/6

此处指定的项目依赖项: https ://github.com/navyad/moviematch/blob/master/mix.exs#L22

当前 Elixir 版本:1.12 和 Erlang/OTP 24 我已将 httpoison 从 1.4 升级到 1.8

脚步

  • 混合 deps.get
  • 混合编译
  • iex -S 混合
  • MovieMatch.Imdb.fetch_imdb_watchlist("ur26610840")
4

2 回答 2

0

如果您看到此错误(或类似错误),则您的本地 Erlang 可能不包含该:ssl包。一个示例 GitHub 问题:

安装:ssl软件包取决于您系统的操作系统。

于 2022-02-07T02:36:50.313 回答
0

我不知道您为什么要从 GitHub 而不是 Hex 签出 Hackney,但我能够通过升级您的依赖项来解决您的问题mix deps update --all

$ mix deps.update --all
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  floki 0.20.4
  html_entities 0.4.0
  metrics 1.0.1
  mimerl 1.2.0
  poison 3.1.0
Upgraded:
  certifi 2.5.1 => 2.6.1
  httpoison 1.5.0 => 1.8.0
  idna 6.0.0 => 6.1.1
  mochiweb 2.18.0 => 2.20.1
  parse_trans 3.3.0 => 3.3.1
  ssl_verify_fun 1.1.5 => 1.1.6
  unicode_util_compat 0.4.1 => 0.7.0 (minor)
New:
* Updating httpoison (Hex package)
* Updating hackney (Hex package)
* Updating certifi (Hex package)
* Updating idna (Hex package)
* Updating parse_trans (Hex package)
* Updating ssl_verify_fun (Hex package)
* Updating unicode_util_compat (Hex package)
* Updating mochiweb (Hex package)

测试:

Generated moviematch app
Interactive Elixir (1.12.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> MovieMatch.Imdb.fetch_imdb_watchlist("ur26610840")

18:39:25.419 [info]  parsing html...

18:39:25.457 [info]  building json...
%{id: "tt11296058", title: "Kunstneren og tyven"}
%{id: "tt11655202", title: "Retfærdighedens ryttere"}
%{id: "tt8185182", title: "Diqiu zuihou de yewan"}
%{id: "tt8637428", title: "The Farewell"}
%{id: "tt8649190", title: "Here Before"}
%{id: "tt9601220", title: "Black Bear"}
%{id: "tt9639470", title: "Last Night in Soho"}

18:39:25.459 [info]  no. of imdb movies: 7
%{
  "tt11296058" => "Kunstneren og tyven",
  "tt11655202" => "Retfærdighedens ryttere",
  "tt8185182" => "Diqiu zuihou de yewan",
  "tt8637428" => "The Farewell",
  "tt8649190" => "Here Before",
  "tt9601220" => "Black Bear",
  "tt9639470" => "Last Night in Soho"
}

在 OTP 24.0.2 和 Elixir 1.12.1 上运行。

于 2021-06-21T09:45:47.613 回答