10 Aug 2013, 01:34
Generic-user-small

Eugene Dorfman (4 posts)

found the issue, turns out that mix run EXPR is deprecated and we should use mix run -e EXPR. In this particular case:

$ mix run -e 'Issues.CLI.run(["--help"])'
10 Aug 2013, 01:34
Generic-user-small

Eugene Dorfman (4 posts)

Hi

I am following the tutorial in ch. 12 (Organizing a Project). At a point where we try to run the Issues.CLI.run function using mix run - it fails with the output below. Looks like mix run treats the expression as a file to be executed and not as a function. Anyone knows what is wrong? Thanks.

$ mix run “Issues.CLI.run([”–help”])” ** (Code.LoadError) could not load /Users/eugene/Documents/elixir/code/my/issues/Issues.CLI.run([–help]) /private/tmp/elixir-uZfU/elixir-0.10.1/lib/elixir/lib/code.ex:283: Code.require_file/2 /private/tmp/elixir-uZfU/elixir-0.10.1/lib/mix/lib/mix/tasks/run.ex:63: Mix.Tasks.Run.run/1 /private/tmp/elixir-uZfU/elixir-0.10.1/lib/mix/lib/mix/cli.ex:38: Mix.CLI.run_task/2 /private/tmp/elixir-uZfU/elixir-0.10.1/lib/elixir/lib/code.ex:291: Code.require_file/2

  You must be logged in to comment