user4104697
user4104697

Reputation:

Elixir phoenix live reload doesn't work

My operating system is the latest macOS high sierra. I installed elixir and all the dependencies via Homebrew. I created a new Phoenix app. It shows some wrong. The live reload doesn't work. Below is the info.

[error] Can't find executable `mac_listener`
[warn] Could not start Phoenix live-reload because we cannot listen to the file system.
You don't need to worry! This is an optional feature used during development to
refresh your browser when you save files and it does not affect production.

It seems that some file change listener service isn't running. But I don't know how to fix it.

Upvotes: 4

Views: 3697

Answers (4)

Edgardo Rodríguez
Edgardo Rodríguez

Reputation: 516

None of the solutions above worked for me. In my case what I had to do to get the phoenix live reload working (setup was ok), was to delete the mix.lock file and then run mix deps.get && mix deps.compile file_system.

Upvotes: 1

rld
rld

Reputation: 2763

I resolved the solution doing this since I already have the xcode-select installed:

 sudo xcode-select --reset

and then:

mix deps.compile file_system

You can check if are installed with: xcode-select -v fot the path: xcode-select -p

Upvotes: 0

Dan
Dan

Reputation: 13

The above answer worked for me (running Mojave), but as commented, apparently doesn't work for everyone. Based on this discussion I came across on Elixir Forum it appears to be a persistent issue other users are having issues as well: Can’t find executable mac_listener - [error] exited in: GenServer.call

One user notes they still had issues after trying all of the following:

  • uninstall Xcode
  • remove Command Line Tools
  • mix deps.clean --all && rm -rf _build deps
  • reinstall Xcode
  • run xcode-select --install, accept the license agreement
  • reboot
  • run mix deps.get && mix deps.compile file_system
  • locate /CoreServices.h
  • export CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include"

The last step that appears to have helped that particular user was to run the following: open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Another Catalina user suggested to set the correct headers path in .bash_profile by running export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"and then recompiling the deps.

Hope this additional information helps someone.

Upvotes: 0

user4104697
user4104697

Reputation:

I solved this problem by reinstalling the command line tools. Open the bash, and type in:

xcode-select --install

And then, run mix deps.compile file_system to recompile the file_system module. done.

Upvotes: 15

Related Questions