Trying to use #ruby & #rails on macos in 2024

Installing ruby 3.x is royal pain with openssl conflicts https://github.com/rvm/rvm/issues/5365

Ruby doesn't compile on macOS if openssl 3.1 is installed · Issue #5365 · rvm/rvm

Description I tried to install ruby-3.2.2 and ruby-3.1.2 on macOS Ventura, after using Homebrew to install rust so I could enable YJIT support for ruby-3.2.2. The rust formula had the openssl@3 for...

GitHub

@rexfeng I have no problems with Ruby dependencies other than if homebrew is involved and updating random stuff, and messing with env and pointing to libraries and stuff outside of homebrew will reference to but then homebrew will remove that referenced stuff again with the next update and so on.

Homebrew is nice for tools but it's terrible for development dependencies.
Especially since you can't point different project dependencies to different versions.

@rexfeng and it looks like homebrew is the culprit in your case as well as you don't have any real control about versions here.
And then you could also pin versions, but of course this might cause other tools not being able to update etc 🙄

@alexanderadam Thanks!

I was able to get my rails app working today by uninstalling & reinstalling `pg` 12

Yesterday, it took a non-trivial amount to install ruby 3.X with openssl 3.0 on macos

I want ruby & rails to succeed, but the DX (as someone who has used rails on & off) can be severely punishing (just to install ruby)

@rexfeng yes that's what I mean. Postgres is the classic example too.
Did you install postgres via homebrew or via development dependencies like asdf ( https://github.com/smashedtoatoms/asdf-postgres?tab=readme-ov-file#asdf-postgres- ), mise or rtx?

Because every time brew decides to update that stuff it will break everything outside again. 🙄

Brew is such a mess for dependencies. 🫣

GitHub - smashedtoatoms/asdf-postgres: asdf plugin for Postgres

asdf plugin for Postgres. Contribute to smashedtoatoms/asdf-postgres development by creating an account on GitHub.

GitHub

@rexfeng it's not only related to Ruby thought, but basically everything that will rely on brew installed libraries by the way.

Brew is just generally a bad idea for these things due to its independence from your project dependencies.