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:

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.

Where Next?

Popular in Questions 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
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
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
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
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
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
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
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New

We're in Beta

About us Mission Statement