Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Observer is not available - Elixir

Tags:

elixir

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?

like image 907
coderVishal Avatar asked Sep 08 '15 04:09

coderVishal


3 Answers

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.

like image 80
José Valim Avatar answered Nov 19 '22 09:11

José Valim


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
like image 2
coderVishal Avatar answered Nov 19 '22 09:11

coderVishal


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.

like image 2
Doyle Turner Avatar answered Nov 19 '22 11:11

Doyle Turner