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

Unable to install ruby v2.7.4 on MacOS Big Sur v11.4 #5099

Closed
razasayed opened this issue Jul 9, 2021 · 1 comment
Closed

Unable to install ruby v2.7.4 on MacOS Big Sur v11.4 #5099

razasayed opened this issue Jul 9, 2021 · 1 comment

Comments

@razasayed
Copy link

razasayed commented Jul 9, 2021

Description

Unable to install ruby v2.7.4 on MacOS Big Sur v11.4

Steps to reproduce

rvm install 2.7.4

I have done rvm get master before running above command to ensure rvm is up to date.

Expected behavior

Should install the version 2.7.4 of ruby.

Actual behavior

The above command gives the error: Error running '__rvm_make -j16'. The full log is as follows:

ruby-2.7.4 - #removing src/ruby-2.7.4 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/11.4/x86_64/ruby-2.7.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/raza/.rvm/rubies/ruby-2.7.4, this may take a while depending on your cpu(s)...
ruby-2.7.4 - #downloading ruby-2.7.4, this may take a while depending on your connection...
ruby-2.7.4 - #extracting ruby-2.7.4 to /Users/raza/.rvm/src/ruby-2.7.4 - please wait
ruby-2.7.4 - #configuring - please wait
ruby-2.7.4 - #post-configuration - please wait
ruby-2.7.4 - #compiling - please wait
Error running '__rvm_make -j16',
please read /Users/raza/.rvm/log/1625826866_ruby-2.7.4/make.log

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

I checked the make.log as per the above error and it has the error: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'. The full log is as follows:

+__rvm_make:0> make -j16
	BASERUBY = /Users/raza/.rvm/rubies/ruby-2.6.6/bin/ruby --disable=gems
	CC = gcc
	LD = ld
	LDSHARED = gcc -dynamiclib
	CFLAGS = -g -O2 -fno-common -pipe 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/x86_64-darwin20 -I./include -I. -I./enc/unicode/12.1.0
	CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   
	DLDFLAGS = -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/raza/.rvm/rubies/ruby-2.7.4/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.4  -fstack-protector-strong -framework Security -framework Foundation  -fstack-protector-strong -framework Security -framework Foundation  
	SOLIBS = -lpthread -lgmp -ldl -lobjc
	LANG = 
	LC_ALL = 
	LC_CTYPE = UTF-8
	MFLAGS = - --jobserver-fds=4,5 -j
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling ast.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
compiling debug.c
compiling debug_counter.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
. ./vm_opts.h
compiling enum.c
dmydln.c:9:5: warning: function 'dln_load' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(NULL);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
1 warning generated.
compiling enumerator.c
compiling error.c
compiling eval.c
cont.c:1852:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
eval.c:745:5: warning: function 'rb_f_raise' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
compiling io.c
compiling iseq.c
gc.c:9575:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
1 warning generated.
compiling load.c
compiling marshal.c
compiling math.c
making mjit_config.h
compiling mjit_compile.c
compiling node.c
1 warning generated.
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling proc.c
compiling process.c
process.c:2938:5: warning: function 'rb_f_exec' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
process.c:4250:5: warning: function 'rb_f_exit' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
process.c:4333:5: warning: function 'rb_f_abort' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
3 warnings generated.
compiling struct.c
compiling symbol.c
compiling thread.c
1 warning generated.
compiling time.c
string.c:6211:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
compiling transcode.c
compiling transient_heap.c
compiling util.c
compiling variable.c
compiling vm.c
variable.c:1749:5: warning: function 'rb_mod_const_missing' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
compiling vm_backtrace.c
compiling vm_dump.c
compiling vm_trace.c
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
In file included from vm.c:344:
./vm_insnhelper.c:5045:43: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
        fprintf(stderr, "%s %s(%d):%p\n", RUBY_FUNCTION_NAME_STRING, bf->name, bf->argc, bf->func_ptr);
                                          ^
In file included from vm.c:350:
./vm_method.c:124:5: warning: function 'rb_f_notimplement' declared 'noreturn' should not return [-Winvalid-noreturn]
    UNREACHABLE_RETURN(Qnil);
    ^
./include/ruby/ruby.h:59:35: note: expanded from macro 'UNREACHABLE_RETURN'
#  define UNREACHABLE_RETURN(val) return (val)
                                  ^
compiling addr2line.c
compiling dmyenc.c
1 warning and 1 error generated.
make: *** [vm.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
1 warning generated.
+__rvm_make:0> return 2

Environment info

ruby-2.6.6:

  system:
    uname:        "Darwin Razas-MacBook-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64"
    name:         "OSX"
    version:      "11.4"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)"
    zsh:          "/bin/zsh => zsh 5.8 (x86_64-apple-darwin20.0)"
    remote_path:  "osx/11.4/x86_64"
    xcode:        "12.5"

  rvm:
    version:      "1.29.12-next (master)"
    updated:      "7 minutes 16 seconds ago"
    path:         "/Users/raza/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.6.6p146"
    date:         "2020-03-31"
    platform:     "x86_64-darwin19"
    patchlevel:   "2020-03-31 revision 67876"
    full_version: "ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]"

  homes:
    gem:          "/Users/raza/.rvm/gems/ruby-2.6.6"
    ruby:         "/Users/raza/.rvm/rubies/ruby-2.6.6"

  binaries:
    ruby:         "/Users/raza/.rvm/rubies/ruby-2.6.6/bin/ruby"
    irb:          "/Users/raza/.rvm/rubies/ruby-2.6.6/bin/irb"
    gem:          "/Users/raza/.rvm/rubies/ruby-2.6.6/bin/gem"
    rake:         "/Users/raza/.rvm/gems/ruby-2.6.6/bin/rake"

  environment:
    PATH:         "/Users/raza/.rvm/gems/ruby-2.6.6/bin:/Users/raza/.rvm/gems/ruby-2.6.6@global/bin:/Users/raza/.rvm/rubies/ruby-2.6.6/bin:/Users/raza/.sdkman/candidates/sbt/current/bin:/Users/raza/.nvm/versions/node/v14.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/raza/.cargo/bin:/Users/raza/go/bin:/Users/raza/.rvm/bin"
    GEM_HOME:     "/Users/raza/.rvm/gems/ruby-2.6.6"
    GEM_PATH:     "/Users/raza/.rvm/gems/ruby-2.6.6:/Users/raza/.rvm/gems/ruby-2.6.6@global"
    MY_RUBY_HOME: "/Users/raza/.rvm/rubies/ruby-2.6.6"
    IRBRC:        "/Users/raza/.rvm/rubies/ruby-2.6.6/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
@razasayed
Copy link
Author

I have been able to resolve this on my computer. Updating XCode and Command Line Tools fixed it for me.Below are the steps i did:

  1. Update XCode
  2. Ran the command brew doctor. This suggested that a new version of command line tools is available.
  3. As suggested by brew doctor ran softwareupdate --all --install --force. This did not show any updates.
  4. So again as suggested by brew doctor removed the existing command line tools and reinstalled with the below commands:
    1. sudo rm -rf /Library/Developer/CommandLineTools
    2. sudo xcode-select --install

I am now able to install different ruby versions. Hope this helps someone else as well.

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

No branches or pull requests

2 participants