postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.9k stars 252 forks source link

Can't install ruby 2.6.7 on M1 macbook #399

Closed tigris closed 3 years ago

tigris commented 3 years ago

FWIW- installing ruby 2.7.3 and ruby 3.0.1 worked flawlessy, and I am extremely grateful for that.

Here is a gist of the install log.

I'm hoping I don't have any crazy ENV setup that would be having an effect here. Here's my env just in case.

TERM_PROGRAM=iTerm.app
GEM_HOME=/Users/danial.pearce/.gem/ruby/2.7.3
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/cw/t8qvyg9j7pvgd5sxqsfjcjch0000gn/T/
TERM_PROGRAM_VERSION=3.4.6
TERM_SESSION_ID=w0t0p0:2E3FA508-BF3B-4DB0-807B-D3E2C7F62A41
USER=danial.pearce
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Bg1PZ7foyR/Listeners
__CF_USER_TEXT_ENCODING=0x0:0:0
BASH_SILENCE_DEPRECATION_WARNING=1
PAGER=less -eRiXF
PATH=/Users/danial.pearce/.gem/ruby/2.7.3/bin:/Users/danial.pearce/.rubies/ruby-2.7.3/lib/ruby/gems/2.7.0/bin:/Users/danial.pearce/.rubies/ruby-2.7.3/bin:/Users/danial.pearce/bin:./node_modules/.bin:/usr/local/sbin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/gsed/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/gnu-which/libexec/gnubin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/gnu-indent/libexec/gnubin:/opt/homebrew/opt/gawk/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/danial.pearce/go/bin:/usr/local/go/bin
RUBY_CONFIGURE_OPTS=--disable-install-doc
__CFBundleIdentifier=com.googlecode.iterm2
PWD=/Users/danial.pearce
EDITOR=vim
LANG=en_AU.UTF-8
ITERM_PROFILE=Default
XPC_FLAGS=0x0
RUBY_ENGINE=ruby
XPC_SERVICE_NAME=0
GPG_TTY=/dev/ttys002
SHLVL=1
HOME=/Users/danial.pearce
COLORFGBG=15;0
LC_TERMINAL_VERSION=3.4.6
GEM_ROOT=/Users/danial.pearce/.rubies/ruby-2.7.3/lib/ruby/gems/2.7.0
ITERM_SESSION_ID=w0t0p0:2E3FA508-BF3B-4DB0-807B-D3E2C7F62A41
LOGNAME=danial.pearce
GEM_PATH=/Users/danial.pearce/.gem/ruby/2.7.3:/Users/danial.pearce/.rubies/ruby-2.7.3/lib/ruby/gems/2.7.0
RUBY_ROOT=/Users/danial.pearce/.rubies/ruby-2.7.3
LC_TERMINAL=iTerm2
RUBYOPT=
RUBY_VERSION=2.7.3
COLORTERM=truecolor
lengarvey commented 3 years ago

This is due to an upstream issue in Ruby: https://bugs.ruby-lang.org/issues/17777

A workaround for this is to run: CFLAGS="-Wno-error=implicit-function-declaration" ruby-install ruby 2.6.7

tigris commented 3 years ago

Thanks!

monfresh commented 2 years ago

For anyone finding this in 2022, this has been fixed starting with 2.6.8. Both 2.6.8 and 2.6.9 install without issue on my M1 Mac. Also, the 2.6.x series will reach end of life in March 2022, so I would upgrade your projects to Ruby 2.7.x or 3.x.