Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD FAILED (macOS 12.0.1 using ruby-build 20211019) #232

Closed
andersennl opened this issue Oct 28, 2021 · 6 comments
Closed

BUILD FAILED (macOS 12.0.1 using ruby-build 20211019) #232

andersennl opened this issue Oct 28, 2021 · 6 comments

Comments

@andersennl
Copy link

andersennl commented Oct 28, 2021

Hi, I'm trying to install Ruby 2.6.5. During the installation I see an error which I'll post below. I'm not sure what could cause the error and if this is the right place to address the issue. In case it's relevant I'm using macOS 12.0.1 on an Apple "M1 Pro" MacBook. Please let me know in case you need more information (for instance the full log). Thank you!

asdf install ruby 2.6.5
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
Installed openssl-1.1.1l to /Users/niko/.asdf/installs/ruby/2.6.5

Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.0.1 using ruby-build 20211019)

Inspect or clean up the working tree at /var/folders/_r/73hpqvps01n344k0bld57x800000gn/T/ruby-build.20211028131523.17883.QC3g3a
Results logged to /var/folders/_r/73hpqvps01n344k0bld57x800000gn/T/ruby-build.20211028131523.17883.log

Last 10 log lines:
        imemo_type_ids[9] = rb_intern("imemo_parser_strterm");
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:1826:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
1340 warnings generated.
linking shared-object objspace.bundle
422 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2
@Stratus3D
Copy link
Member

Looking at the ruby-build issues (https://github.com/rbenv/ruby-build/issues) it looks like there are several people reporting issues with OSX 11, so I'm not surprised you've run into an issue with OSX 12. I'm still on OSX 10 so I don't have any way to debug this right now.

@andersennl
Copy link
Author

andersennl commented Oct 28, 2021

I was actually just reading through issues over there and found RUBY_CFLAGS="-w".

My installation worked with the following command: RUBY_CFLAGS="-w" asdf install ruby 2.6.5.

Thanks again.

@RocketSH
Copy link

RocketSH commented Mar 8, 2022

For any newcomer, I am using MacBook Air (M1, 2020) MacOS Monterey 12.2.1. When I try to install Ruby 2.6.5 I encountered a similar issue(BUILD FAILED (macOS 12.2.1 using ruby-build 20210928).

I gave command: RUBY_CFLAGS="-w" asdf install ruby 2.6.5 a try, it also worked for me.

@devAffe
Copy link

devAffe commented Aug 8, 2023

I'm using a M1 Mac as well with macOS 13.0.1 and I tried this command with the ruby version 3.2.2 but it didn't work for me. I still got the message that the build had failed.
BUILD FAILED (macOS 13.0.1 using ruby-build 20230717)

@RocketSH
Copy link

RocketSH commented Aug 9, 2023

Hey @devAffe Just guessing, did you install a c library before? It's worth checking your global environment variables again, if there are CFLAGS defined it might cause this error, in this case we can consider using direnv to manage environment variables by directory.

@fbuys
Copy link

fbuys commented Mar 19, 2024

Following the instruction over here helped me: rbenv/ruby-build#2309 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants