KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 154 forks source link

Hex is not found even though installed with asdf #1507

Open ealione opened 5 years ago

ealione commented 5 years ago

When running mix phx.server on the terminal my application will execute as expected. Trying it from IntelliJ I get the following message,

Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]

the command that IntelliJ is trying to run is,

/home/user/.asdf/installs/erlang/22.0.3/bin/erl -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/elixir/ebin -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/ex_unit/ebin -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/mix/ebin -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/logger/ebin -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/eex/ebin -pa 
/home/user/.asdf/installs/elixir/1.9.0-rc.0/lib/iex/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/mnesia-4.16/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/compiler-7.4.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/asn1-5.0.9/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/runtime_tools-1.13.3/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/xmerl-1.3.21/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/os_mon-2.5/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/debugger-4.2.7/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/erts-10.4.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/ftp-1.0.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/parsetools-2.1.8/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/erl_interface-3.12/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/stdlib-3.9.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/erl_docgen-0.9.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/wx-1.8.8/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/megaco-3.18.5/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/tools-3.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/public_key-1.6.7/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/et-1.6.4/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/dialyzer-4.0.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/eunit-2.3.7/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/hipe-3.19/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/syntax_tools-2.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/snmp-5.3/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/diameter-2.2.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/ssh-4.7.7/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/crypto-4.5.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/sasl-3.4/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/edoc-0.11/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/ssl-9.3.2/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/kernel-6.4/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/eldap-1.2.8/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/inets-7.0.8/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/tftp-1.0.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/observer-2.9.1/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/common_test-1.17.3/ebin -pa 
/home/user/.asdf/installs/erlang/22.0.3/lib/reltool-0.8/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra /home/user/.asdf/installs/elixir/1.9.0-rc.0/bin/mix phx.server

Both the elixir and erlang plugins are installed and configured, running on Manjaro.

Since I already have installed hex I do not want to install it again in a different location, how should intellij-elixir be configured in order to locate it properly?

allenwyma commented 4 years ago

@esmeraldaliaj as a workaround, I have added the ebin folder to the "classpath" for my elixir version: ~/.asdf/installs/elixir/VERSION/.mix/archives/hex-VERSION/hex-VERSION/ebin

Cervajz commented 4 years ago

Same goes for rebar. I'd say it is connected to https://github.com/KronicDeth/intellij-elixir/issues/1760

blakedietz commented 2 years ago

@esmeraldaliaj as a workaround, I have added the ebin folder to the "classpath" for my elixir version: ~/.asdf/installs/elixir/VERSION/.mix/archives/hex-VERSION/hex-VERSION/ebin

For those still running into this issue, this was the same fix that I ended up using as well.

To do so

Trevoke commented 2 years ago

I somehow created this issue in my project. I had it configured correctly and then at some point I wasn't thinking, I saw the "elixir framework detected" message, clicked on it, and clicked OK in the window that popped up.

The workaround explained above (adding the ebin path manually) worked for me.

maxmarcon commented 2 years ago

This issue is incredibly annoying. Question: why can't Intellij simply run its processes using the system's shell, instead of apparently trying to replicate all the system's settings internally?

@esmeraldaliaj as a workaround, I have added the ebin folder to the "classpath" for my elixir version: ~/.asdf/installs/elixir/VERSION/.mix/archives/hex-VERSION/hex-VERSION/ebin

I'd like to try this out but when I click on the + button the file selection modal that pops up doesn't allow me to select folders starting with .. How do I work around that?

KronicDeth commented 2 years ago

Showing hidden folders in a macOS Open Dialog is done using the shortcut Cmd+Shift+.. Getting an input to just type in a path is Cmd+Shift+G. These are both macOS specific things and not something specific to IntelliJ.

maxmarcon commented 2 years ago

Thank you very much! I will keep these key combinations under my pillow 😄