josh.nz

josh.nz

Solution to failure to install PostgreSQL when following Engineering Elixir Applications book

I’m starting to follow the book Engineering Elixir Applications, and immediately ran into an issue installing PostgreSQL 15.2 on macOS 15.4.1:

note: 'strchrnul' has been marked as being introduced in macOS 15.4 here, but the deployment target is macOS 15.0.0

Apparently this issue affects macOS 15.4.0+, and has been fixed in a PostgreSQL patch for versions 13-17, but that patch doesn’t seem out yet (at least for 15).

For now, I managed to install it by exporting the following line first, before the asdf install (page 9 of the book):

export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion)"

Note that I’m using mise instead of asdf, but I believe the same issue will be present with asdf as mise just uses the asdf postgres plugin.

Details of the issue for anyone interested:

I originally found the pgenv solution, which linked to the above bug discussion:
https://github.com/theory/pgenv/issues/93

I hope this helps people.

Marked As Solved

josh.nz

josh.nz

Apparently this issue affects macOS 15.4.0+, and has been fixed in a PostgreSQL patch for versions 13-17, but that patch doesn’t seem out yet (at least for 15).

For now, I managed to install it by exporting the following line first, before the asdf install (page 9 of the book):

export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion)"

Also Liked

aglassman

aglassman

Just use docker compose. It’s so much easier to manage various projects that require different versions of services like postgres, mysql, redis, etc.

Schultzer

Schultzer

Thanks, this helped me out when I had to setup a new company laptop!

josh.nz

josh.nz

This might be a better solution long term but a) I’m not overly familiar with Docker (which is partly why I’m reading this book), and b) I was trying to follow the book as close as possible.

There’s always a tension when following technical books; if you deviate too far, you might run into issues you need to diagnose yourself and that might be challenging depending on the nature of the issue and your experience level. At the same time, books can date fast, so you might run into similar issues when following the book directly anyway. Since this book is relatively new, I expected minimal to no issues following the book directly, but the recent macOS update obviously had an impact.

Last Post!

josh.nz

josh.nz

This might be a better solution long term but a) I’m not overly familiar with Docker (which is partly why I’m reading this book), and b) I was trying to follow the book as close as possible.

There’s always a tension when following technical books; if you deviate too far, you might run into issues you need to diagnose yourself and that might be challenging depending on the nature of the issue and your experience level. At the same time, books can date fast, so you might run into similar issues when following the book directly anyway. Since this book is relatively new, I expected minimal to no issues following the book directly, but the recent macOS update obviously had an impact.

Where Next?

Popular in Questions Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
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

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement