You have not upgraded Ubuntu-shipped elixir this way. The proper way of doing it would be by installing a DEB package.
You have installed elixir the manual way. Which means it’s installed without any dependencies and thanks to $PATH priority you are using newer version of Elixir. But the old one is also in the system.
I do not think this is proper set up and if you install packages this way, you will have trouble in the long run.
These are for both: Elixir and Erlang. Uninstall the system-provided versions, add those repositories and install what you need. They will update nicely.
Having said that, they don’t have ELixir 1.4 released just yet. It will take them a few days at least to do so I think.
The version manager allows you to have multiple versions of Erlang, Ruby, Node or Elixir installed at the same time and switch between those on per-project basis. Very useful if you run more than one project. I highly recommend you going this route.
Sure. You also do not really have to do make install, so it never installs elixir in system. Just run make and set up $PATH correctly so it uses the elixir from the build destination directory. It will work.
I’m using asdf myself, which @hubertlepicki mentioned; it’s really simple to get started with, as can be seen in the instructions on GitHub. For Ubuntu, given that you already have Erlang/OTP installed, it would end up something like this:
# Install 'asdf' itself
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.2.1
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
# Add Elixir plugin
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
# Activate in current shell
. $HOME/.asdf/asdf.sh
# Install Elixir 1.4 & make it global default
asdf install elixir 1.4.0
asdf global elixir 1.4.0
Only the last two commands are needed, of course, if you already use asdf.
This way, you’ll have a nice setup where you can switch between any number of Elixir versions, set a global default, and set a project-level default that will be used whenever you’re in that project directory…
Nonetheless, I’ll say that it’s valuable to know how to install Elixir from source without any additional tooling as well Bonus points for compiling OTP, too, but there are a few more dependencies to think about there, if you want the end result to be full-featured.
The last time I took a look at asdf it was neither capable of using a preinstalled system version nor was it able to install arbitrary tags/branches/SHAs from git.
This was really a showstopper for me, has this changed for elixir and erlang?
For Elixir, it seems to download releases only, but definitely makes use of preinstalled system version of Erlang/OTP just fine.
If I recall correctly, kiex does a better job there, at least handling arbitrary branches (haven’t tested anything else). However, I’m usually not interested in anything except released Elixir versions (unless it’s for pure experimentation, in which case I can clone the repo and compile it myself).
The major selling point of asdf for me, has been the .tool-versions file we can keep in our repository to 1) automatically use the specified Elixir version whenever we’re in the project directory, and 2) make sure everyone in the team is on the same version without complicating matters further.
@NobbZ, do you know of any other option that would provide the same conveniences but allow what you’re after - to install any tag/branch/SHA?
asdf .tool-versions documentation mentions that you can specify a version like ref:master or even path:location. I’m using the later to keep a local elixir dev version for myself.
I didn’t know it can do it <3. As @NobbZ I thought it was lacking that feature, probably was true in the early days.
I like this version manager specifically for the reason that with one .tool-versions file you can specify all your requirements for say, Ruby, Elixir, Node and Erlang in one place. This is perfect for me