Skip to content

rbenv install 2.6.5 failing: BUILD FAILED (macOS 11.6 using ruby-build 20210928) #1803

Closed

Description

@amitmahajan12

Please see the attached log. It is unclear to me what is wrong. I'll appreciate any help I can get.

% rbenv install 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/amitmahajan/.rbenv/versions/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 11.6 using ruby-build 20210928)

Inspect or clean up the working tree at /var/folders/qn/6glckh8s1jn5x74lj7bkm7gr0000gn/T/ruby-build.20211006144832.95659.r8FA33
Results logged to /var/folders/qn/6glckh8s1jn5x74lj7bkm7gr0000gn/T/ruby-build.20211006144832.95659.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

ruby-build.20211006144832.95659.log

Activity

  1. transferred this issue fromrbenv/rbenvon Oct 6, 2021
  2. me25hage commented on Oct 12, 2021

    @me25hage

    I have this same Build Failed error with 3.0.0 except, my build fails during the install of openssl-1.1.1l. Log attached.

    ruby-build.20211012143529.16821.log

    Downloading openssl-1.1.1l.tar.gz...
    -> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
    Installing openssl-1.1.1l...

    BUILD FAILED (macOS 11.6 using ruby-build 20210928)

    Inspect or clean up the working tree at /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.OcOFOF
    Results logged to /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.log

    Last 10 log lines:
    ${LDCMD:-clang} -arch arm64 -O3 -Wall -L. -Wl,-search_paths_first -L/usr/local/var/rbenv/versions/3.0.0/lib
    -o fuzz/client-test fuzz/client.o fuzz/test-corpus.o
    -lssl -lcrypto
    ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
    ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
    ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
    make depend && make _build_libs
    make[1]: Nothing to be done for `_build_libs'.
    Cannot create directory /usr/local/var: Permission denied
    make: *** [install_runtime_libs] Error 2

  3. amitmahajan12 commented on Oct 12, 2021

    @amitmahajan12
    Author

    I had multiple versions of ruby installed. After I uninstalled everything and reinstalled only 2.6.5, it worked for me. I think failing during install of openssl-1.1.1l may be a different issue anyway.

  4. gplusdotgr commented on Nov 29, 2021

    @gplusdotgr
    v14.18.1  ~/r/documentation    rbenv install 2.6.4                                                  Mon Nov 29 12:06:37 2021
    Downloading openssl-1.1.1l.tar.gz...
    -> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
    Installing openssl-1.1.1l...
    Installed openssl-1.1.1l to /Users/gkatsanos/.rbenv/versions/2.6.4
    
    Downloading ruby-2.6.4.tar.bz2...
    -> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.4.tar.bz2
    Installing ruby-2.6.4...
    ruby-build: using readline from homebrew
    
    BUILD FAILED (macOS 12.0.1 using ruby-build 20211109)
    
    Inspect or clean up the working tree at /var/folders/y5/dphtsvm95_38xml5cs344hn80000gn/T/ruby-build.20211129120640.19263.BPu93D
    Results logged to /var/folders/y5/dphtsvm95_38xml5cs344hn80000gn/T/ruby-build.20211129120640.19263.log
    
    Last 10 log lines:
    linking shared-object stringio.bundle
    linking shared-object -test-/string.bundle
    5 warnings generated.
    4 warnings generated.
    linking shared-object zlib.bundle
    1 warning generated.
    linking shared-object psych.bundle
    422 warnings generated.
    linking shared-object date_core.bundle
    make: *** [build-ext] Error 2
    

    nothing works ..

  5. rivitt commented on Dec 3, 2021

    @rivitt

    I'm getting this same error on macOS 11.6 and 12.0.1 (m1 chip), I'm going to uninstall and reinstall everything and see where that takes me

  6. iamricks commented on Dec 8, 2021

    @iamricks

    I'm getting the same issue trying to install 2.6.3 but i am able to install and use 3.0.2 and 3.0.3 just fine, maybe the issue is just with 2.6.x?

  7. x-warukira commented on Jun 27, 2022

    @x-warukira

    export optflags="-Wno-error=implicit-function-declaration" worked for me

  8. JShefferCorp commented on Aug 15, 2022

    @JShefferCorp

    export optflags="-Wno-error=implicit-function-declaration"

    Thanks, this also worked for me.
    MacOS: 12.5
    Processor: Apple M1 Pro

  9. markst commented on Jun 8, 2023

    @markst

    Legend @x-warukira! That's finally fixed being unable to install 2.6.0 on my M1

  10. mrmeszaros commented on Jul 27, 2023

    @mrmeszaros

    export optflags="-Wno-error=implicit-function-declaration" worked for me

    This Worked on my machine
    MacOS: Ventura (13.4.1)
    Processor: Apple M1 Pro

    On that note - would it be possible to persistently set that variable for the context of ruby-build or rbenv-install?

    @x-warukira How did You find the solution? I am interested to see what component reads the optflags variable!

  11. monfresh commented on Jul 27, 2023

    @monfresh

    There are several misconceptions going on here. First, the "-Wno-error=implicit-function-declaration" flag should never be set. It's a dangerous hack that overrides macOS defaults, as explained here: #2001 (comment)

    I've been using Ruby for 13 years and not a single time have I ever had to set that flag. If you have a proper Ruby dev setup, and you're installing the appropriate version of Ruby in the appropriate context, you should never need to set that flag.

    The second misconception is that if your project is using a specific version of Ruby, then your only option is to install that specific version. I see so many people try to install older versions of Ruby 2.6.x, like in this GitHub issue, when the solution is to update your project to the latest patch version (the 3rd digit), which is 2.6.10.

    rbenv/ruby-build can install 2.6.x versions as old as 2.6.8 on Apple Silicon Macs in native mode without any issues and without having to set any flags.

    Here's a detailed article I wrote that explains how and why to upgrade the Ruby version in your project.

    If for some highly unlikely reason you absolutely need to use a version of 2.6.x older than 2.6.8, then the best option is to use Rosetta.

  12. locked and limited conversation to collaborators on Jul 27, 2023
  13. converted this issue into a discussion #2221 on Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions