I am working on ubuntu 14.04 LTS. I installed elixir as per instructions given in the offical website ran the following lines in console and everything works fine
Add Erlang Solutions repo: wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
Run: sudo apt-get update
Run: sudo apt-get install elixir
But when i run :observer.start in the iex shell,i get the following error
** (UndefinedFunctionError) undefined function: :observer.start/0 (module :observer is not available) :observer.start()
I ran a few commands after looking up the net, to solve the issue
apt list | grep -i erlang
It gave back many lines of which this could be relevance
erlang-observer/unknown 1:18.0 amd64
Any help on how to make it work?
Update
It seems that other modules like :dbg and :mnesia is working. Though I cant confirm if all the modules are working. Also wonder why some are working and some arent?
Can you be sure Erlang was also installed from Erlang Solutions? Distributions are known to break Erlang into multiple packages (Erlang Solutions does not), so if observer is not available, you very likely need to install erlang-observer indeed.
Thanks to @JoseValim, simply re-running the commands(without deleting anything) helped me. I think the first time I must have had some internet connectivity issue.
Add Erlang Solutions repo: wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
Run: sudo apt-get update
Run: sudo apt-get install elixir
It's worth noting that the observer requires a GUI.
When this may not be clear: if you are running iex on WSL and using remote-connection from VS Code or through any terminal connected to WSL.
There aren't any issues with developing on this setup, but if you need an observer it isn't going to be available through the terminal connected to WSL because of the lack of GUI. There are some options available to install a GUI on WSL for remote connection from the Windows machine, but I suspect this would result in the same outcome if using Windows tooling with WSL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With