Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elixir Undefined function

Tags:

elixir

Elixir beginner here. I am attempting to run a hello world elixir script from the iex

The script is a basic hello world example

IO.puts "Hello World!"

I run the following command from iex

iex(1)> elixir hello.exs

and get this error:

** (CompileError) iex:1: undefined function elixir/1

Not sure why I am getting an error, any help would be appreciated. Thanks

like image 475
dhuenecke Avatar asked Feb 06 '23 17:02

dhuenecke


1 Answers

Just so the answer is not buried in a comment:

You should run elixir hello.exs from the shell, not inside iex

like image 168
Onorio Catenacci Avatar answered Feb 23 '23 07:02

Onorio Catenacci