How to use ex_doc in Opensuse Leap when Elixir lang is installed through zyapper or system wide?

I have installed Elixir on my Opensuse Leap system using the docs from elixir-lang. And was learnig use of ex_doc but it isn’t installing the way mix deps.get should have . Installed through package manager but its not working. Kindly help

You can certainly install ex_doc via mix, via something like

{:ex_doc, "~> 0.19", only: :dev, runtime: false}

It may be installed as an archive. You can check installed archives with mix archive. If you wish to uninstall it you can use mix archive.uninstall <archive>

I actually did that before trying to install from package manager. Exdoc. 0.19 version requires Elixir 1.17 version. Zyapper installs elixir 1.6.

Then you want an earlier version. From the changelog there is a notice: β€œThis release requires Elixir v1.7 and later. For earlier Elixir versions, use ExDoc ~> 0.18.0.”

Therefore you should use this in your deps:

def deps
  [
    ...other deps
    {:ex_doc, "~> 0.18.0", only: :dev, runtime: false},
  ]
end

I actually did that giving multiple different version(0.12, 0.18.0, 0.18.4) of ex_doc before installing it from the system software using this Opensuse ex_doc

Now I removed ex_doc from the system software and reinstalled mix. But getting the same issue as before.

>mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  earmark 1.2.5
New:
  ex_doc 0.18.4
* Updating ex_doc (Hex package)
Request failed (:timeout)
If this happens consistently, adjust your concurrency and timeout settings:

    HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get
** (Mix) Package fetch failed and no cached copy available (https://repo.hex.pm/tarballs/ex_doc-0.18.4.tar)

I even tried to give github specific path so that it picks up the right version, but it’s not accepting and giving the above error. Or doesn’t connect.

This seems to indicate some type of firewall issue. Perhaps you are behind a restrictive corporate firewall? Can you directly download https://repo.hex.pm/tarballs/ex_doc-0.18.4.tar from this computer?

I actually did download the ex_doc and wasn’t sure how to use that. Tried to check on elixir-lang IRC but couldn’t get much help. So thought to reach here. I still do have ex_doc-0.18.4.tar file with me. How to use that for my project than.

Untar it into deps of your application.

It then should have roughly the following structure:

.
|-lib
|-deps
|  |-earmark
|  \-ex_doc
|-priv
\-tests

Perhaps I’m missing some of the default folders, perhaps I misspelled them, but the important bits are in deps anyway.

ex_docfil> tree
.
β”œβ”€β”€ CHECKSUM
β”œβ”€β”€ contents.tar.gz
β”œβ”€β”€ metadata.config
└── VERSION

0 directories, 4 files

and when extracted the content tar file. I got this

ex_docfil> tree

.
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CHECKSUM
β”œβ”€β”€ contents.tar.gz
β”œβ”€β”€ formatters
β”‚ β”œβ”€β”€ epub
β”‚ β”‚ β”œβ”€β”€ dist
β”‚ β”‚ β”‚ β”œβ”€β”€ app-bbb6f0765d.js
β”‚ β”‚ β”‚ └── epub-612b95d9a4.css
β”‚ β”‚ └── metainfo
β”‚ β”‚ β”œβ”€β”€ com.apple.ibooks.display-options.xml
β”‚ β”‚ └── container.xml
β”‚ └── html
β”‚ β”œβ”€β”€ dist
β”‚ β”‚ β”œβ”€β”€ app-480ffdc169.css
β”‚ β”‚ β”œβ”€β”€ app-9bd040e5e5.js
β”‚ β”‚ └── app-9bd040e5e5.js.map
β”‚ └── fonts
β”‚ β”œβ”€β”€ icomoon.eot
β”‚ β”œβ”€β”€ icomoon.svg
β”‚ β”œβ”€β”€ icomoon.ttf
β”‚ └── icomoon.woff
β”œβ”€β”€ lib
β”‚ β”œβ”€β”€ ex_doc
β”‚ β”‚ β”œβ”€β”€ cli.ex
β”‚ β”‚ β”œβ”€β”€ formatter
β”‚ β”‚ β”‚ β”œβ”€β”€ epub
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ assets.ex
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ templates
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ content_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ extra_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ head_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ media-types.txt
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ module_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ nav_item_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ nav_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ title_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ └── toc_item_template.eex
β”‚ β”‚ β”‚ β”‚ └── templates.ex
β”‚ β”‚ β”‚ β”œβ”€β”€ epub.ex
β”‚ β”‚ β”‚ β”œβ”€β”€ html
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ assets.ex
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ autolink.ex
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ templates
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ api_reference_entry_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ api_reference_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ detail_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ extra_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ footer_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ head_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ module_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ not_found_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ redirect_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ search_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ sidebar_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ summary_item_template.eex
β”‚ β”‚ β”‚ β”‚ β”‚ └── summary_template.eex
β”‚ β”‚ β”‚ β”‚ └── templates.ex
β”‚ β”‚ β”‚ └── html.ex
β”‚ β”‚ β”œβ”€β”€ group_matcher.ex
β”‚ β”‚ β”œβ”€β”€ markdown
β”‚ β”‚ β”‚ β”œβ”€β”€ cmark.ex
β”‚ β”‚ β”‚ └── earmark.ex
β”‚ β”‚ β”œβ”€β”€ markdown.ex
β”‚ β”‚ └── retriever.ex
β”‚ β”œβ”€β”€ ex_doc.ex
β”‚ └── mix
β”‚ └── tasks
β”‚ └── docs.ex
β”œβ”€β”€ LICENSE
β”œβ”€β”€ metadata.config
β”œβ”€β”€ mix.exs
β”œβ”€β”€ README.md
└── VERSION

Those were the files inside ex_doc-0.18.4.tar

Ah, okay, then I previously misunderstood how the tarbal is built. The content of contents.tar.gz has to be in deps/ex_doc.

I’m still wondering why you were able to download earmark, but not ex_doc… Both are served via hex…

1 Like