Open blakeperdue opened 2 years ago
I was also having difficulty building Ruby. I'm using:
frum version 0.1.2 macOS Monterey 12.6 (M1 Macbook/Apple Silicon)
My errors output similar to this:
Undefined symbols for architecture arm64:
"_rb_enc_set_base", referenced from:
_Init_encdb in encdb.o
"_rb_enc_set_dummy", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_alias", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_declare", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_dummy", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_replicate", referenced from:
_Init_encdb in encdb.o
"_rb_encdb_set_unicode", referenced from:
_Init_encdb in encdb.o
ld: symbol(s) not found for architecture arm64
I solved this for myself by looking at Homebrew's ./configure
options for Ruby:
And I used this command:
frum install 3.1.2 --enable-shared --disable-silent-rules --without-gmp
And it worked! 🎉
I wish I understood why that works -- given there's linker errors, I think --enable-shared
might be doing the trick ¯\_(ツ)_/¯
Thanks a lot! I had the same issue, tried your solution and it worked! 🙌
Same here. it worked! Many thanks @eddieantonio 😀
@eddieantonio and others who might wonder why --enable-shared
is required, it's due to an incompatibility between version 14.x of Apple's command line tools and Ruby. Ruby fixed the issue in 3.1.3 and 2.7.7, but they haven't been released yet. Once they are released, the --enable-shared
flag would not be needed anymore. I've written about this in detail here:
https://www.rubyonmac.dev/how-to-install-ruby-on-macos-12-6-apple-silicon
As for the other flags from Homebrew, --disable-silent-rules
doesn't do anything because it's not recognized by Ruby. And although --without-gmp
is a Ruby configuration option, it won't make a difference.
@monfresh Thanks! That's a write-up!
I've googled this issue for hours now and give up. I've tried all the solutions I could find online yet I am unable to use frum to install any Ruby versions. A log is below.
My setup: Macbook Air M2 frum v0.1.2