Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby 2.6.6 in Mac m2

Has anyone managed to install version 2.6.6 on a mac m2?

I get this error when trying to install:

$ ruby-install ruby 2.6.6
exts.mk updated
compiling strscan.c
linking shared-object strscan.bundle
Undefined symbols for architecture x86_64:
...
  "_rb_warning", referenced from:
      _strscan_clear in strscan.o
      _strscan_getbyte in strscan.o
      _strscan_peep in strscan.o
      _strscan_empty_p in strscan.o
      _strscan_restsize in strscan.o
  "_ruby_xfree", referenced from:
      _strscan_free in strscan.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../.ext/x86_64-darwin22/strscan.bundle] Error 1
make[1]: *** [ext/strscan/all] Error 2
make: *** [build-ext] Error 2

In RVM:

rvm install 2.6.6                                                                                                            phoenix-api/git/improve/rm_study_gfk_and_import_bugs !
ruby-2.6.6 - #removing src/ruby-2.6.6 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.2/x86_64/ruby-2.6.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/rrmartins/.rvm/rubies/ruby-2.6.6, this may take a while depending on your cpu(s)...
ruby-2.6.6 - #downloading ruby-2.6.6, this may take a while depending on your connection...
ruby-2.6.6 - #extracting ruby-2.6.6 to /Users/rrmartins/.rvm/src/ruby-2.6.6 - please wait
ruby-2.6.6 - #configuring - please wait
ruby-2.6.6 - #post-configuration - please wait
ruby-2.6.6 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/rrmartins/.rvm/log/1676579014_ruby-2.6.6/make.log

There has been an error while running make. Halting the installation.

I tried install with ruby-install 2.6.6 and rvm install 2.6.6

anybody can help me! tks

like image 1000
Rodrigo Martins Avatar asked Jan 26 '26 03:01

Rodrigo Martins


1 Answers

This issue was reported on GitHub in the rbenv/ruby-build repo.

It was responded to by hsbt, a core contributor to Ruby, who pointed the user to the Ruby mailing list issue #18912, where they said:

TL;DR: We fixed this issue at Ruby 2.7-3.1 and master branch. But the stable versions are not released yet.

Option 1: We strongly recommend to not upgrade Xcode 14 and its toolchains for macOS 12(Monterey) users. If you already update Xcode 14, you remove them with sudo rm -rf /Library/Developer/CommandLineTools and install Xcode 13.x or toolchains from https://developer.apple.com/download/all

Option 2: macOS 13 (Ventura) couldn't install Xcode13. We should add --without=+,bigdecimal --enable-shared to the configure option.

Unfortunately for you, if you have an M2 Mac then you likely have macOS Ventura. None of these instructions will help you because you can't downgrade macOS or the Xcode Command Line tools.

In your case, I would advise that you make the effort to upgrade your version of Ruby rather than jump through any of these hoops because it's unlikely that you'll succeed in compiling it. Ruby 2.6 hit end-of-life nearly a year ago and 2.7 will do the same in about a month -- it's time to upgrade.

like image 60
anothermh Avatar answered Jan 28 '26 19:01

anothermh