Skip to content

Mac OS 10.14 Error running '__rvm_make -j4' #4484

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

Closed
sandergroen opened this issue Oct 27, 2018 · 43 comments
Closed

Mac OS 10.14 Error running '__rvm_make -j4' #4484

sandergroen opened this issue Oct 27, 2018 · 43 comments
Milestone

Comments

@sandergroen
Copy link

Description

I'm trying to install ruby (any version) via rvm but getting this error: Error running '__rvm_make -j4.

Steps to reproduce

I installed the master version of rvm. Then I do a rvm install ruby-2.5.3.

Expected behavior

An installed ruby.

Actual behavior

Error running '__rvm_make -j4.

Environment info

system:

system:
uname: "Darwin MacBook-Pro-van-Sander.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64"
name: "OSX"
version: "10.14"
architecture: "x86_64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)"
zsh: "/bin/zsh => zsh 5.3 (x86_64-apple-darwin18.0)"
remote_path: "osx/10.14/x86_64"

rvm:
version: "1.29.4 (master)"
updated: "1 day 13 hours 11 minutes 2 seconds ago"
path: "/Users/sgroen/.rvm"
autolibs: "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

homes:
gem: "not set"
ruby: "not set"

binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"

environment:
PATH: "/Users/sgroen/.cargo/bin:/opt/local/bin:/opt/local/sbin:/anaconda3/bin:/usr/local/graphviz/bin:/Users/sgroen/Library/Haskell/bin:/Users/sgroen/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/Users/sgroen/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""

@sandergroen sandergroen changed the title Mac OS 10.14 Mac OS 10.14 Error running '__rvm_make -j4' Oct 27, 2018
@Ozkee
Copy link

Ozkee commented Oct 30, 2018

Hey, got same problem.. same error on make.log so I will not duplicate.. more information about attempts to fix:

rvm mount -r https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2
results in installing ruby with no binary: ruby-2.3.8 [ missing bin/ruby ], trace:

https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2 - #configure
ruby-2.3.8 - #download
ruby-2.3.8 - #validate archive
ruby-2.3.8 - #extract
ruby-2.3.8 - #validate binary
ruby-2.3.8 - #setup
Missing 'ruby' in 'rubygems_detect_ruby_lib_gem_path'.
ruby-2.3.8 - #gemset created /Users/regis/.rvm/gems/ruby-2.3.8@global
ruby-2.3.8 - #importing gemset /Users/regis/.rvm/gemsets/global.gems......................there was an error installing gem rubygems-bundler
....................
ruby-2.3.8 - #generating global wrappers.......
ruby-2.3.8 - #gemset created /Users/regis/.rvm/gems/ruby-2.3.8
ruby-2.3.8 - #importing gemsetfile /Users/regis/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.8 - #generating default wrappers.......
Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main

@Ozkee
Copy link

Ozkee commented Oct 30, 2018

@sandergroen finally fixed on my machine.. try uninstall all gcc version from brew and use the one from the system /usr/bin/gcc (or at least try CC=/usr/bin/gcc rvm install x.x.x)

@sandergroen
Copy link
Author

sandergroen commented Oct 30, 2018

@Ozkee I just tried but with no luck. I still got the same errors in my log file. I updated all xcode stuff already.

@RTJ
Copy link

RTJ commented Nov 4, 2018

I had exactly the same problem in OSx Mojave. ( After the upgrade to Mojave )
In my case the problem was AVAST Antivirus ...
I spent the whole day looking for the solution and turning off the antivirus the problem was solved and everything works for me.

@sandergroen
Copy link
Author

@RTJ no AVAST here but still the same issue. I am using docker for now since I can't find a solution at this moment.

@jdinse
Copy link

jdinse commented Jan 5, 2019

Same Problem here. Anyone know how to fix this issue?

@DaniG2k
Copy link

DaniG2k commented Jan 14, 2019

+1

@DaniG2k
Copy link

DaniG2k commented Jan 14, 2019

Finally was able to get it working. Did the following:

sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
xcode-select --install

once that worked I did

sudo rm -rf /Library/Developer/CommandLineTools.old
brew uninstall cctools
rvm get stable; rvm reload; rvm install "ruby-2.5.1"

@jdinse
Copy link

jdinse commented Jan 14, 2019

Nope, that didn't work for me.

Compared to similar issues, my make.log says the same as @sandergroen's does:

linking static-library libruby.2.5.1-static.a
libtool: object: dln.o malformed object (unknown load command 1)
libtool: object: localeinit.o malformed object (unknown load command 1)
libtool: object: loadpath.o malformed object (unknown load command 1)
libtool: object: array.o malformed object (unknown load command 1)
libtool: object: bignum.o malformed object (unknown load command 1)
libtool: object: class.o malformed object (unknown load command 1)
...

I guess the problem lays somewhere around here.

I opened a question on Stack Overflow about this.

@iamsolarpowered
Copy link

I've tried all of the above suggestions and I'm still experiencing this error. Anyone have other ideas? I'm pretty much stumped at this point.

@tleish
Copy link

tleish commented Mar 7, 2019

Only other workaround I've read is, after the install fails

$ cd /your/ruby/build/download/dir
$ make install
$ rvm repair all

note: rbenv currently has a similar issue (see: rbenv/ruby-build#992)

@iamsolarpowered
Copy link

iamsolarpowered commented Mar 7, 2019 via email

@nachocases
Copy link

I had the same problem and was able to finally solve it (I was trying to install using rbenv but also rvm was failing for me with the same error). Basically my problem was with MacPorts, I had to upgrade macports (by reinstalling it) and then port selfupdate, port upgrade outdated and found the issue when this failed for gcc, then I've run port uninstall obsolete, once I did that, rbenv worked like a charm

@belgoros
Copy link

belgoros commented Mar 25, 2019

Same problem when installing ruby 2.6.2, just the number after __rvm_make is different :

Error running '__rvm_make -j8',

Screenshot 2019-03-25 at 10 17 08

I followed the Ruby on Rails installation guide and installed ruby 2.6.1 a month ago without any problems.
I took a look at the indicated log file ~/.rvm/log/1553504891_ruby-2.6.2/make.log, - no errors just warnings and it finishes with lines:

7 warnings generated.
linking shared-object socket.bundle
7 warnings generated.
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
+__rvm_make:0> return 2

I'm using the latest rvm version: rvm 1.29.7. The same error is happening when installing an inferior ruby version (2.5.0):

command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
gpg: key 3804BB82D39DC0E3: 47 signatures not checked due to missing keys
gpg: key 3804BB82D39DC0E3: "Michal Papis (RVM signing) <mpapis@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
➜  ~ rvm install ruby-2.5.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.5.0.
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/Serguei/.rvm/rubies/ruby-2.5.0, this may take a while depending on your cpu(s)...
ruby-2.5.0 - #downloading ruby-2.5.0, this may take a while depending on your connection...
ruby-2.5.0 - #extracting ruby-2.5.0 to /Users/Serguei/.rvm/src/ruby-2.5.0 - please wait
ruby-2.5.0 - #applying patch /Users/Serguei/.rvm/patches/ruby/2.5.0/prelude_gcc_diagnostic.patch - please wait
ruby-2.5.0 - #applying patch /Users/Serguei/.rvm/patches/ruby/2.5.0/libressl_2_7.patch - please wait
ruby-2.5.0 - #configuring - please wait
ruby-2.5.0 - #post-configuration - please wait
ruby-2.5.0 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/Serguei/.rvm/log/1553506425_ruby-2.5.0/make.log

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

Trying t apply the solution described id #4307 didn't solve the problem.

@mmcc8394
Copy link

Similar problem for me and found the answer on this thread:

[https://github.com//issues/4271]

It was basically an openSSL issue (for me). Just to summarize the solution:

brew install openssl
rvm install 2.5.0 --with-openssl-dir=`brew --prefix openssl`

@belgoros
Copy link

@mmcc8394 I checked the openssl keg, here is what it is:

brew info openssl
openssl: stable 1.0.2r (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2q (1,794 files, 12.1MB)
  Poured from bottle on 2019-01-14 at 14:57:57
/usr/local/Cellar/openssl/1.0.2r (1,795 files, 12.1MB)
  Poured from bottle on 2019-03-25 at 09:55:33
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Analytics
install: 770,980 (30 days), 1,656,646 (90 days), 6,318,675 (365 days)
install_on_request: 118,740 (30 days), 225,100 (90 days), 887,481 (365 days)
build_error: 0 (30 days)

Should I reinstall it ? Should I also symlink it (I'm using Om My Zsh terminal) ?

@belgoros
Copy link

belgoros commented Apr 18, 2019

It worked for me 👍
Attention for using back quotes in the below part of the command:

brew --prefix openssl

when I just copy-pasted it in the Terminal, they were dropped:

rvm install 2.6.3 --with-openssl-dir=brew --prefix openssl
Unrecognized command line flag: '--prefix'
Run `rvm help` to see usage information

@sandergroen
Copy link
Author

Everything mentioned here does not work for me. I reinstalled the commandline tools and tried to install a ruby version with --with-openssl-dir=brew --prefix openssl. I also uninstalled and installed homebrew. But none of it worked. Could it be that I have some linker issue?
How can I cleanup everything and start from scratch?

@mmcc8394
Copy link

While the fix I mentioned above helped me get Ruby installed, I ended up having errors from other gems when I tried to install them.

I can't remember exactly what I did (sorry about that), but I know that the final solution was to force Brew to redo my OpenSSL links:

brew link --force openssl

That updated a bunch of symlinks and ultimately fixed my compilation problems.

@jdinse
Copy link

jdinse commented Apr 24, 2019

In my case it was an old installation of MacPorts which I didn't updated after upgrading MacOS to Mojave. After removing all old MacPorts Packages und installing RVM again, it worked.

Fully described here in this issue on stackoverflow.

@sandergroen
Copy link
Author

I finally succeeded installing a Ruby I had to remove /opt/local/bin/libtool. I stumbled across a similar error when I was trying to compile some c code.

@rcoproc
Copy link

rcoproc commented May 5, 2019

I remove the executable /opt/local/bin/libtool

and install ruby with this

rvm install ruby-2.6.3 --with-openssl-dir='/opt/local'

@stefano-babylon
Copy link

stefano-babylon commented Jun 11, 2019

I've tried rvm install 2.3.6 --with-openssl-dir=(brew --prefix openssl) (I'm using fish hence the different syntax).

I've uninstalled and reinstalled rvm.

I've uninstalled and reinstalled openssl with homebrew.

I've run brew link openssl and brew link --force openssl, passing along fish_user_paths, LDFLAGS, CPPFLAGS, and PKG_CONFIG_PATH as specified in brew info openssl.

I don't have MacPorts installed so there are no conflicts from the /opt/local directory (it doesn't exist on my machine.

I've also re-installed my Xcode command line tools as outlined above.

And I've tried make install inside /Users/stefanodevuono/.rvm/src/ruby-2.3.6. It errors out.

I still can't get

rvm install 2.3.6

to work on my machine (MacOS Mojave 10.14.5, Darwin 18.6.0).

Here's my error log:

[2019-06-10 17:33:27] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /Users/stefanodevuono/.rvm/src/ruby-2.3.6
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/bin:/bin:/usr/local/opt/openssl/bin:/Users/stefanodevuono/.asdf/installs/golang/1.11.2/packages/bin:/Users/stefanodevuono/bin:/Users/stefanodevuono/.asdf/shims:/Users/stefanodevuono/.asdf/bin:/Users/stefanodevuono/.n/bin:/Users/stefanodevuono/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Users/stefanodevuono/.rvm/bin
GEM_PATH=
command(2): __rvm_make -j8
++ make -j8
	CC = gcc
	LD = ld
	LDSHARED = gcc -dynamiclib
	CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens   -fno-common -pipe 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
	CPPFLAGS = -I/usr/local/opt/openssl/include -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/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I. -I.ext/include/x86_64-darwin18 -I./include -I.
	DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -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/lib -install_name /Users/stefanodevuono/.rvm/rubies/ruby-2.3.6/lib/libruby.2.3.0.dylib -compatibility_version 2.3 -current_version 2.3.6  -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation  -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation  
	SOLIBS = -lpthread -ldl -lobjc 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
translating probes probes.d
compiling main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
. ./vm_opts.h
compiling dir.c
compiling dln_find.c
compiling encoding.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
eval.c:776:8: warning: unused variable 'mid' [-Wunused-variable]
    ID mid = me->called_id;
       ^
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
1 warning generated.
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
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
compiling struct.c
compiling symbol.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling version.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm_dump.c
compiling vm_backtrace.c
compiling vm_trace.c
compiling thread.c
thread.c:1085:27: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32]
        tp->tv_usec = ts.tv_nsec / 1000;
                    ~ ~~~~~~~~~~~^~~~~~
compiling cont.c
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
compiling dmyenc.c
compiling dln.c
config.status: creating ruby-runner.c
compiling localeinit.c
compiling prelude.c
compiling array.c
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c
compiling enc/utf_8.c
compiling enc/trans/newline.c
1 warning generated.
linking miniruby
generating encdb.h
rbconfig.rb updated
generating enc.mk
creating verconf.h
encdb.h updated
verconf.h updated
compiling loadpath.c
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
linking static-library libruby.2.3.0-static.a
verifying static-library libruby.2.3.0-static.a
ld: warning: ignoring file libruby.2.3.0-static.a, file was built for archive which is not the architecture being linked (x86_64): libruby.2.3.0-static.a
Undefined symbols for architecture x86_64:
  "_ruby_init", referenced from:
      _main in main.o
  "_ruby_init_stack", referenced from:
      _main in main.o
  "_ruby_options", referenced from:
      _main in main.o
  "_ruby_run_node", referenced from:
      _main in main.o
  "_ruby_sysinit", referenced from:
      _main in main.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: *** [libruby.2.3.0-static.a] Error 1
make: *** Waiting for unfinished jobs....
transdb.h updated
++ return 2

@AxlTom
Copy link

AxlTom commented Jul 29, 2019

Only other workaround I've read is, after the install fails

$ cd /your/ruby/build/download/dir
$ make install
$ rvm repair all

note: rbenv currently has a similar issue (see: rbenv/ruby-build#992)

thanks,wo just run ' rvm repair all',it worked for me

@759803573
Copy link

linking static-library libruby.2.3.0-static.a
verifying static-library libruby.2.3.0-static.a
ld: warning: ignoring file libruby.2.3.0-static.a, file was built for archive which is not the architecture being linked (x86_64): libruby.2.3.0-static.a
Undefined symbols for architecture x86_64:
  "_ruby_init", referenced from:
      _main in main.o
  "_ruby_init_stack", referenced from:
      _main in main.o
  "_ruby_options", referenced from:
      _main in main.o
  "_ruby_run_node", referenced from:
      _main in main.o
  "_ruby_sysinit", referenced from:
      _main in main.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: *** [libruby.2.3.0-static.a] Error 1
make: *** Waiting for unfinished jobs....
transdb.h updated
++ return 2

I have the same problem as @stefano-babylon

please help me.

@nick-bigger
Copy link

nick-bigger commented Nov 21, 2019

Sep 2019 had the same issue, running:
rvm install ruby-2.6.5 --with-openssl-dir='{directory of openssl}'
worked for me.

I didn't have luck with the make install approach, as running that command threw an error for me. For those wondering where to look, the path to my installation was ~/.rvm/src/ruby-2.6.5. Maybe it will work for you.

Instead, I had to run: echo $LDFLAGS to figure out where openssl was installed to. For me, it turned out to be /usr/local/opt/openssl. Running the above command with this directory fixed the issue!

@s2imon
Copy link

s2imon commented Nov 23, 2019

Sep 2019 had the same issue, running:
rvm install ruby-2.6.5 --with-openssl-dir='{directory of openssl}'
worked for me.

I didn't have luck with the make install approach, as running that command threw an error for me. For those wondering where to look, the path to my installation was ~/.rvm/src/ruby-2.6.5. Maybe it will work for you.

Instead, I had to run: echo $LDFLAGS to figure out where openssl was installed to. For me, it turned out to be /usr/local/opt/openssl. Running the above command with this directory fixed the issue!

This exact approach worked for me. Thanks a bunch!

@mime29
Copy link

mime29 commented Dec 12, 2019

Besides the openssl issue, you might encounter the following one as well:

If you have multiple versions of Xcode installed on your Mac, you might have /Application/Xcode 11.1.app and /Application/Xcode.app folders.
If you select the default to be the 11.1 it will fail with an error:

/bin/sh: /Applications/Xcode: No such file or directory

so you need to do:

sudo xcode-select -s /Applications/Xcode.app
rvm install 2.6.4

and you'll get:

ruby-2.6.4 - #removing src/ruby-2.6.4 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.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/one/.rvm/rubies/ruby-2.6.4, this may take a while depending on your cpu(s)...
ruby-2.6.4 - #downloading ruby-2.6.4, this may take a while depending on your connection...
ruby-2.6.4 - #extracting ruby-2.6.4 to /Users/one/.rvm/src/ruby-2.6.4 - please wait
ruby-2.6.4 - #configuring - please wait
ruby-2.6.4 - #post-configuration - please wait
ruby-2.6.4 - #compiling - please wait
ruby-2.6.4 - #installing - please wait
ruby-2.6.4 - #making binaries executable - please wait
ruby-2.6.4 - #downloading rubygems-3.0.6
ruby-2.6.4 - #extracting rubygems-3.0.6 - please wait
ruby-2.6.4 - #removing old rubygems - please wait
$LANG was empty, setting up LANG=en_US.US-ASCII, if it fails again try setting LANG to something sane and try again.
ruby-2.6.4 - #installing rubygems-3.0.6 - please wait
ruby-2.6.4 - #gemset created /Users/one/.rvm/gems/ruby-2.6.4@global
ruby-2.6.4 - #importing gemset /Users/one/.rvm/gemsets/global.gems - please wait
ruby-2.6.4 - #generating global wrappers - please wait
ruby-2.6.4 - #gemset created /Users/one/.rvm/gems/ruby-2.6.4
ruby-2.6.4 - #importing gemsetfile /Users/one/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.6.4 - #generating default wrappers - please wait
ruby-2.6.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.6.4 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri

@Nickk-Kim
Copy link

Finally was able to get it working. Did the following:

sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
xcode-select --install

once that worked I did

sudo rm -rf /Library/Developer/CommandLineTools.old
brew uninstall cctools
rvm get stable; rvm reload; rvm install "ruby-2.5.1"

it works for me. great thanks!

@meetme2meat
Copy link

meetme2meat commented Jan 31, 2020

May be this help ...

brew install homebrew/portable-ruby/portable-openssl
rvm reinstall ruby-2.3.1 --with-openssl-dir=/usr/local/opt/portable-openssl/

But I'm still not sure why it worked with brew portable-openssl vs the 1.0.2t openssl against which I was compiling the ruby manually.

@feihuang89
Copy link

I remove the executable /opt/local/bin/libtool

and install ruby with this

rvm install ruby-2.6.3 --with-openssl-dir='/opt/local'

@rcoproc you save my life, Thank you!

@bingdff
Copy link

bingdff commented Mar 26, 2021

Finally was able to get it working. Did the following:

sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
xcode-select --install

once that worked I did

sudo rm -rf /Library/Developer/CommandLineTools.old
brew uninstall cctools
rvm get stable; rvm reload; rvm install "ruby-2.5.1"

now it works , thanks !!!

@stoikerty
Copy link

My error seemed the same but wasn't, I used export warnflags=-Wno-error=implicit-function-declaration which allowed me to install ruby-2.6.7. I got the suggestion from: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy'...

@jorgex10
Copy link

For me this works: reinstall xcode, then sudo xcode-select -s /Applications/Xcode.app and finally rvm install "ruby-2.6.x"

@amandaclarck
Copy link

For Mac Big Sur (it took 5 developers and hours and hours to figure out the solution)?

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcode-select -s /Library/Developer/CommandLineTools

@djgable
Copy link

djgable commented May 26, 2021

My error seemed the same but wasn't, I used export warnflags=-Wno-error=implicit-function-declaration which allowed me to install ruby-2.6.7. I got the suggestion from: 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy'...

Appreciate the assist! This is the only thing that worked for us for 2.6.7

@philip13
Copy link

Finally was able to get it working. Did the following:

sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.old
xcode-select --install

once that worked I did

sudo rm -rf /Library/Developer/CommandLineTools.old
brew uninstall cctools
rvm get stable; rvm reload; rvm install "ruby-2.5.1"

Hi, I have this error, right now have iOS Monterrey

brew uninstall cctools
Error: No available formula or cask with the name "cctools". Did you mean cuetools, cdrtools, cpmtools, vcftools, hcxtools, bcftools, mtools or xctool?

@DaniG2k
Copy link

DaniG2k commented Nov 12, 2021

@philip13 if you don't have cctools installed it shouldn't be a problem. You can just proceed with the next commands.

@philip13
Copy link

philip13 commented Nov 13, 2021

@philip13 if you don't have cctools installed it shouldn't be a problem. You can just proceed with the next commands.

Yep, thanks.
I resolve my problem uninstall rvm and remove the folder /.rvm,
next change the default terminal Zsh to bash chsh -s /bin/bash,
next install rvm using the second instruction in the official rvm.io webpage\curl -sSL https://get.rvm.io | bash -s stable and next install your version rvm install "ruby-2.5.1", that all

Reference
https://rvm.io/
https://nrogap.medium.com/install-rvm-in-macos-step-by-step-d3b3c236953b

@belgoros
Copy link

belgoros commented Mar 15, 2022

@meetme2meat

/usr/local/opt/portable-openssl/

this path does not exist on macOS Monterey:

drwxr-xr-x   3 root  wheel    96B Mar  7 15:30 lib
➜  local pwd
/usr/local
➜  local ll
total 0
drwxr-xr-x  15 root  wheel   480B Mar  7 15:30 bin
drwxr-xr-x   3 root  wheel    96B Mar  7 15:30 lib

@meetme2meat
Copy link

@belgoros

➜  ~ brew info homebrew/portable-ruby/portable-openssl
homebrew/portable-ruby/portable-openssl: stable 1.1.1l [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/portable-openssl/1.0.2t (97 files, 8.7MB)
  Built from source on 2020-01-31 at 16:10:11
From: https://github.com/Homebrew/homebrew-portable-ruby/blob/HEAD/Formula/portable-openssl.rb
License: OpenSSL
==> Caveats
portable-openssl is keg-only, which means it was not symlinked into /usr/local,
because portable formulae are keg-only.

Just adding here /usr/local/opt/portable-openssl/ is symlink to /usr/local/Cellar/portable-openssl/1.0.2t

@bradbyte
Copy link

In case this helps anyone, I was trying to install 3.1.2 and getting the same error.. after lots of troubleshooting and trying different solutions, here is how I solved it.

$ rvm pkg install openssl 
$ rvm install ruby-3.1.2 --with-openssl-dir=$HOME/.rvm/usr

My guess is that this openssl version (v1) was needed instead of v3 which I believe homebrew installed.

@JSoon
Copy link

JSoon commented Aug 29, 2023

In case this helps anyone, I was trying to install 3.1.2 and getting the same error.. after lots of troubleshooting and trying different solutions, here is how I solved it.

$ rvm pkg install openssl 
$ rvm install ruby-3.1.2 --with-openssl-dir=$HOME/.rvm/usr

My guess is that this openssl version (v1) was needed instead of v3 which I believe homebrew installed.

Pls note that you should modify the $HOME/.rvm/user -> $HOME/.rvm/user/ssl, then everything's working like a charm.

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