From Ruby to Elixir: Stuck at the start (page 20)

The primary cause was a typo in the “defmodule” in one.ex.

However, I still find the path to the example files confusing: just prior to setting up the examples, the book has us run “mix new examples” (p19) which creates a new folder, “examples,” which contains a “lib” folder where we are to place our source code. The first example on the following page, however, places the “one.ex” in a path that has those folder names in reverse: “elixir_examples/lib/examples/modules/one.ex” so it’s confusing, especially since the top-level directory is different than the “examples” directory just created, and then we have to add two empty directories inside lib (including a confusing second instance of “examples”.

I think I understand it now, but I found it a bit confusing. Enjoying working through the rest of the otherwise excellent book, though!

1 Like