sdtda
April 19, 2023, 10:13pm
1
Hi, Im a noob trying install Elixir 1.14.4 on Erlang 23 Precompiled package in my Debian 11 stable.
Ive installed Erlang 23 from debian repos, so I download the precompiled package then I unzip it in ~/elixir/ then I add to my ~/.bash_profile :
export PATH="$PATH:~/elixir/bin/elixir"
export PATH="$PATH:~/elixir/bin/mix"
But when I run: elixir --version return command not found.
How can I do? Im following the Installing Elixir - The Elixir programming language instructions
Hi,
Did you literally put /path/to/elixir/bin
in your bash profile? If that is the case, replace it with the actual path to the elixir bin directory. I guess for you it would be ~/elixir/bin
.
Then restart your terminal and check. If that doesn’t work, look at the result of echo $PATH
. If the elixir bin directory is not there try running source ~/.bash_profile
2 Likes
sdtda
April 20, 2023, 5:00am
3
I literally put in my bash profile:
export PATH="$PATH:~/elixir/bin/elixir"
export PATH="$PATH:~/elixir/bin/mix"
adamu
April 20, 2023, 6:56am
4
As @hochata said, it should be
export PATH="$PATH:~/elixir/bin"
2 Likes
sdtda
April 20, 2023, 1:09pm
5
Works! but only in the user terminal, it dont work by systemd
Now I try run mix from systemd:
systemd unit:
[Unit]
Description=mix script
[Service]
Restart=on-failure
User=appuser
Environment="MIX_ENV=prod"
WorkingDirectory=/opt/app
; Path to the Mix binary.
Environment="PATH=$PATH:/home/user/elixir/bin"
ExecStart=/home/user/elixir/bin/mix phx.server
PrivateTmp=true
ProtectHome=true
ProtectSystem=full
PrivateDevices=false
CapabilityBoundingSet=~CAP_SYS_ADMIN
[Install]
WantedBy=multi-user.target
In systemd unit user (appuser) .bash_profile I put:
export PATH="$PATH:/home/user/elixir/bin"
adamu
April 21, 2023, 2:17am
6
You shouldn’t use mix
with systemd, you should build a release , and start that.
sdtda
April 27, 2023, 4:03pm
7
I need use mix with systemd