Hi, I am new to Elixir.I am learning elixir by reading Programming Elixir.I got trouble when I build a simple client and try to fetch issues from github.
I did follow step in book:
$ iex -S mix
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:4:4] [async-threads:10]...
==> idna (compile)
Compiled idna
Compiled mimerl
: :
Generated issues app
and when I type Issues.GithubIssues.fetch("elixir-lang", "elixir")
it should show follow stuff:
iex(1)>
report erratum • discuss
Task: Use Libraries • 149Let’s try it out:
iex> Issues.GithubIssues.fetch("elixir-lang", "elixir")
{:ok,
"[{\"url\":\"https://api.github.com/repos/elixir-lang/elixir/issues/4126\",
\"labels_url\":\"https://api.github.com/repos/elixir-lang/elixir/...",
\"comments_url\":\"https://api.github.com/repos/elixir-lang/elixir/...",
\"events_url\":\"https://api.github.com/repos/elixir-lang/elixir/...",
\"html_url\":\"https://github.com/elixir-lang/elixir/issues/4126\",
\"id\":124284664,\"number\":4126,
\"title\":\"#put_in function with structs raises
but I got a mistake like this:
Eshell V8.3 (abort with ^G)
Compiling 3 files (.ex)
Generated issues app
Interactive Elixir (1.4.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Issues.GithubIssues.fetch("elixir-lang", "elixir")
** (UndefinedFunctionError) function :unicode_util.lowercase/1 is undefined (module :unicode_util is not available)
:unicode_util.lowercase('api.github.com')
(idna) f:/study/learnElixir/issues/deps/idna/src/idna.erl:57: :idna.lowercase_list/1
(idna) f:/study/learnElixir/issues/deps/idna/src/idna.erl:10: :idna.to_ascii/1
(hackney) f:/study/learnElixir/issues/deps/hackney/src/hackney_url.erl:96: :hackney_url.normalize/2
(hackney) f:/study/learnElixir/issues/deps/hackney/src/hackney.erl:291: :hackney.request/5
(httpoison) lib/httpoison/base.ex:432: HTTPoison.Base.request/9
(issues) lib/issues/github_issues.ex:6: Issues.GithubIssues.fetch/2
I really don’t know how to fix unicode_util.lowercase
function.So I really appreciate your suggestions.
Thanks!