M2 mac airbook installation

The mac comes with ruby 2.6.8. I need an older version (2.3.5). Ive installed home brew, and rbenv. Trying to get 2.3.5 installed it fails on tcl\tk. I cannot figure out where to get the libraries and how to get it installed.

Why does 2.3.5 require this, and the default version bundled with the mac doesn’t?

This is interesting … for most folks with Apple Silicon machines, the snag is with FFI and sometimes OpenSSL. In theory this might work for you:


Of course if it is some weirdness about expecting the tcl/tk library to be present, you can install that:

brew install tcl-tk

And if nothing flies for the ARM64 side of things, open an x64 shell by installing Rosetta, and then install the x64 version of rbenv and probably things can come together.

Crossing fingers for ya!

Tried that didn’t work. Maybe my homebrew is in the wrong location/opt, it warns me to uninstall and reinstall under usr/local.

I have no idea how to do that, i might just return this MacBook air.

Hmmm, check if you will what this brings back:

which brew

Should report back /opt/homebrew/bin/brew, and if it doesn’t then something is fishy. If it is goofed up then it would be worth a try to first completely uninstall Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

and then reinstall, hopefully this time it will end up under /opt/homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

ok I found a script to uninstall homebrew and I installed homebrew in usr/local ok. Got rails 3.1.2 and latest version of rails installed.

But I require 2.3.5, and its still failing on the tcl-tk libraries (even though I installed them with brew).

I’ve had problems with these installs too. I have no idea if this is part of the problem, but rbenv isn’t the only option. I use chruby because it’s simpler. But there are other options.


Listing the rubies installed with the current one highlighted. This is an M1 MBA which I got about six months ago, just as the M2 was coming out but I couldn’t wait.

ok here is another problem…

At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4.

when I installed tcl-tk, it install version 8.6, not a working version for apple m2

can I specify which version I install using homebrew?

tried installing with chruby, same issue it fails at tcl-tk.

I need a compatible version :frowning:

Some progress – on an M1 machine running Ventura 13.0 that uses rvm to manage Ruby versions, was able to do all of this:

brew install libffi
export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
rvm install 2.3.8

and it ended up with a properly installed core Ruby 2.3.8, and without the rubygems. Could then change to that Ruby and list its version:

lorin@Lorins-MacBook-Pro ~ % rvm use ruby-2.3.8
Using /Users/lorin/.rvm/gems/ruby-2.3.8
lorin@Lorins-MacBook-Pro ~ % ruby -v
ruby 2.3.8p459 (2018-10-18 revision 65136) [-darwin22]

So the only last snag really is to figure out how to get the rubygems in place.

Curious about your interest specifically in Ruby 2.3.5 – are you hoping to run a Rails 4.x or 5.x site?

Its not my idea, our organization is behind running 2.3.5.

I did get my personal project running on ruby 3.0.4, and rails ~ 6.something.

I"m going to move my virtual machine to the mac and hopefully work on that until i can get it working natively.

There is also the Rosetta option – in any Terminal window run this:

softwareupdate --install-rosetta

and then this x64 emulator is there to do your bidding! Pretty much any Intel thing can be done, and you have to install its own Homebrew and rbenv and so forth, but then Ruby 2.3.5 should be possible, and hopefully a bit more straightforward.

I do think that I’m close with the other though … have gotten 2.3.8 going …

I can’t install rosetta on this m2.

I might just return it and get an m1

Wow that is remarkable – I thought there was total compatibility between the M1 and M2. Maybe I’ve just got the wrong command line on this one or something.

i found this

CONFIGURE_OPTS=--without-tk rbenv install 1.8.7-p370

but it didn’t quite work for me. Isn’t there a way to build a ruby version if you don’t need tck-tk?

What MacOS are you on? Here i am wondering about ZIPping up the already-installed 2.3.8 that I’ve got kicking around and sending it over to you.

And if you really need 2.3.5, which is mostly the same thing as 2.3.8 but without some security patches, then I can probably install that instead and send over instructions.

what would happen if I tried running the app using 2.6.10 (my mac system default)

Should probably run either just fine or with minimal modification – it’s not until Ruby 2.7 that things transitioned a bit with the way that methods use keyword arguments. So on 2.6.x you’re free from hitting any of those snags.

Look out for any mention of trouble with “Fixnum” and “Bignum” – those are two numeric classes that got merged into being “Integer” in Ruby 2.4. There is a patch that I can provide for you if you end up hitting that snag.

ok, I’ve cloned my app to my desktop, and made some changes in my gemfile to reflect the system version of ruby (2.6.10).
Trying to bundle the application, but it’s been over an hour and it’s still resolving dependancies…

I went from bad to worse, lol

No fear on this – there’s also installing 2.6.10 using rbenv, and then doing the same. Things are well at this point!

Sometimes “resolving dependencies” hangs up because the network connection had a small snag. It’s OK to CTRL-C if it lets you, and then attempt another time.

Also good to run:

ps aux | grep bundle

And see what it reports – anything that’s using bundle should show in that list.

I’d be surprised if Ruby 2.3 would compile on an ARM64 machine.

I did find this blog post so maybe there is hope :pray: