joeerl

joeerl

Creator of Erlang - Fondly Remembered

Upgrading Elixir - how to check versions, delete, and upgrade?

Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questions.

I want to start of with the “latest and greatest” so that my questions when I get stuck are relevant. So

  1. What do I need and how do I get them

I think I need Elixir Erlang and Mix and possibly Hex

I have in the past installed all of these - so my file system is a bit of a historical mess - so

  • how do I find out which versions I already have?
  • how do I find out the latest versions?
  • how do do I update to the latest versions?
  • how do I delete old versions if they are not needed?

I realize I can find the answers to all these questions by Googling and experimentation but it would be very nice to find the answers “all in one place”

The “brew doctor” command is pretty good at flushing out old systems and telling me what to do - so it would be very nice if there was an equivalent command - let me daydream a bit:

> elixir doctor
Wow Joe you already have elixir installed
but it's a really old version ...
you might like to delete the old version with 'elixir 
remote_old_versions'
and then do 'elixir upgrade'
....

Cheers

/Joe

Most Liked

cpgo

cpgo

Im a big fan of GitHub - asdf-vm/asdf: Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more · GitHub.
You can manage a multitude of language versions, including elixir and erlang and set up global or per project versions.

12
Post #2
ryanwinchester

ryanwinchester

I know this is old but I’m here to not preach language version managers or anything and just offer the simplest most straightforward upgrade since you mentioned you are using homebrew?

Upgrading Elixir if it was installed with homebrew is pretty easy. Erlang is a dependency that will be installed or updated for you by homebrew as needed.

  1. brew update
  2. brew upgrade elixir
  3. elixir --version

(I never do brew upgrade without a specfic formula, as that has caused me many headaches in the past)

Happy Elixiring!

10
Post #9
peerreynders

peerreynders

As you seem to be using homebrew you can use $ brew list FORMULA:

$ brew list elixir
/usr/local/Cellar/elixir/1.7.2/bin/elixir
/usr/local/Cellar/elixir/1.7.2/bin/elixirc
/usr/local/Cellar/elixir/1.7.2/bin/iex
/usr/local/Cellar/elixir/1.7.2/bin/mix
/usr/local/Cellar/elixir/1.7.2/lib/eex/ (7 files)
/usr/local/Cellar/elixir/1.7.2/lib/elixir/ (231 files)
/usr/local/Cellar/elixir/1.7.2/lib/ex_unit/ (29 files)
/usr/local/Cellar/elixir/1.7.2/lib/iex/ (30 files)
/usr/local/Cellar/elixir/1.7.2/lib/logger/ (12 files)
/usr/local/Cellar/elixir/1.7.2/lib/mix/ (90 files)
/usr/local/Cellar/elixir/1.7.2/share/man/ (4 files)
$ brew list erlang
/usr/local/Cellar/erlang/21.0.5/bin/ct_run
/usr/local/Cellar/erlang/21.0.5/bin/dialyzer
/usr/local/Cellar/erlang/21.0.5/bin/epmd
/usr/local/Cellar/erlang/21.0.5/bin/erl
/usr/local/Cellar/erlang/21.0.5/bin/erlc
/usr/local/Cellar/erlang/21.0.5/bin/escript
/usr/local/Cellar/erlang/21.0.5/bin/run_erl
/usr/local/Cellar/erlang/21.0.5/bin/to_erl
/usr/local/Cellar/erlang/21.0.5/bin/typer
/usr/local/Cellar/erlang/21.0.5/lib/erlang/ (4393 files)
/usr/local/Cellar/erlang/21.0.5/share/doc/ (1261 files)
$

to upgrade simply follow the usual homebrew process:

$ brew update

and then

$ brew upgrade
$ elixir -v
Erlang/OTP 21 [erts-10.0.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.7.2 (compiled with Erlang/OTP 21)
$

For that command to work Erlang and Elixir have to be on the PATH. So in your ~/.bash_profile there should be something like:

export PATH=/usr/local/opt/openssl/bin:/usr/local/opt/erlang/bin:/usr/local/opt/elixir/bin:$PATH;

Cleanup:

$ brew list --versions erlang
erlang 21.0 20.3.6 21.0.5 21.0.4 20.3.4
$ brew list --versions elixir
elixir 1.7.1 1.6.5 1.6.4 1.7.2 1.6.6
$ brew cleanup elixir
Removing: /usr/local/Cellar/elixir/1.6.4... (411 files, 5.4MB)
Removing: /usr/local/Cellar/elixir/1.6.5... (411 files, 5.4MB)
Removing: /usr/local/Cellar/elixir/1.6.6... (412 files, 5.4MB)
Removing: /usr/local/Cellar/elixir/1.7.1... (413 files, 5.5MB)
==> This operation has freed approximately 21.7MB of disk space.
$ brew cleanup erlang
Removing: /usr/local/Cellar/erlang/20.3.4... (7,036 files, 277.4MB)
Removing: /usr/local/Cellar/erlang/20.3.6... (7,036 files, 277.3MB)
Removing: /usr/local/Cellar/erlang/21.0... (5,668 files, 271.8MB)
Removing: /usr/local/Cellar/erlang/21.0.4... (5,668 files, 271.7MB)
==> This operation has freed approximately 1GB of disk space.
$ 

Where Next?

Popular in Questions Top

tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement