asdf-vm / asdf-ruby

Ruby plugin for asdf version manager
https://github.com/asdf-vm/asdf
MIT License
652 stars 133 forks source link

Ruby 3.1.2 compile fails on OSX 12.5 #294

Open mciasuen opened 2 years ago

mciasuen commented 2 years ago

# sw_vers

ProductName:    macOS
ProductVersion: 12.5
BuildVersion:   21G72

# asdf ---version

v0.10.2

# asdf plugin-update ruby

Updating ruby to master
Already on 'master'
Your branch is up to date with 'origin/master'.

# asdf install ruby 3.1.2

Downloading openssl-3.0.5.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a
Installing openssl-3.0.5...
Installed openssl-3.0.5 to /Users/asuen/.asdf/installs/ruby/3.1.2

Downloading ruby-3.1.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz
Installing ruby-3.1.2...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.5 using ruby-build 20220726)

Inspect or clean up the working tree at /var/folders/dt/c4qrxscx2575pdycxkxqgpb40000gn/T/ruby-build.20220815164602.55804.uPxSX4
Results logged to /var/folders/dt/c4qrxscx2575pdycxkxqgpb40000gn/T/ruby-build.20220815164602.55804.log

Last 10 log lines:
                                                                       ^
In file included from compile.c:40:
./vm_callinfo.h:216:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
    if (debug) rp(ci);
               ^
./internal.h:94:72: note: expanded from macro 'rp'
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
                                                                       ^
2 errors generated.
make: *** [compile.o] Error 1

I also tried permutations of optflags=-Wno-error=implicit-function-declaration / ASDF_RUBY_BUILD_VERSION=v20220630 from #285 and RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" from #258 none of it affected the problem.

jagthedrummer commented 2 months ago

I just ran into this same issue when trying to install version 3.3.3. After a bunch of searching I came across this answer on StackOverflow that did the trick.

https://stackoverflow.com/a/73230207/631187

First I ran this:

sudo xcode-select -s /Library/Developer/CommandLineTools

And then could successfully do:

asdf install ruby 3.3.3