Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Can't install another version of ruby #1709

Closed
iharkatkavets opened this issue Jan 17, 2021 · 3 comments
Closed

Can't install another version of ruby #1709

iharkatkavets opened this issue Jan 17, 2021 · 3 comments

Comments

@iharkatkavets
Copy link

OS:
macOS BigSur 11.1 (20C69)
rbenv 1.1.2-40-g62d7798

I run command to install new version of ruby '$ rbenv install 2.7.2' and I got error

$ rbenv install 2.7.2
Downloading openssl-1.1.1i.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to /Users/igork/.rbenv/versions/2.7.2

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

BUILD FAILED (macOS 11.1 using ruby-build 20201225-4-g02ce13c)

Inspect or clean up the working tree at /var/folders/yq/0qgh9s2s3mv9mj8qcr1tndk00000gn/T/ruby-build.20210117184954.54049.ZDBDN6
Results logged to /var/folders/yq/0qgh9s2s3mv9mj8qcr1tndk00000gn/T/ruby-build.20210117184954.54049.log

Last 10 log lines:
linking shared-object openssl.bundle
linking shared-object ripper.bundle
./revision.h unchanged
linking ruby
make[1]: Nothing to be done for `note'.
Generating RDoc documentation
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /var/folders/yq/0qgh9s2s3mv9mj8qcr1tndk00000gn/T/ruby-build.20210117184954.54049.ZDBDN6/ruby-2.7.2/ruby
Reason: image not found
make: *** [rdoc] Abort trap: 6

Output from log file:

raddrinfo.c:442:41: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int') [-Wshorten-64-to-32]
return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
~~~~~~~~~~~ ^~~~~~~
raddrinfo.c:442:56: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int') [-Wshorten-64-to-32]
return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
~~~~~~~~~~~ ^~~~~~~
linking shared-object json/ext/parser.bundle
compiling ifaddr.c
linking shared-object date_core.bundle
compiling ossl_pkey_ec.c
compiling getaddrinfo.c
compiling ossl_pkey_rsa.c
linking shared-object json/ext/generator.bundle
compiling getnameinfo.c
getaddrinfo.c:410:7: warning: add explicit braces to avoid dangling else [-Wdangling-else]
} else if (strcmp(sp->s_proto, "tcp") == 0) {
^
installing default socket libraries
compiling ossl_rand.c
compiling ossl_ssl.c
compiling ossl_ssl_session.c
compiling ossl_x509.c
compiling ossl_x509attr.c
compiling ossl_x509cert.c
compiling ossl_x509crl.c
1 warning generated.
compiling ossl_x509ext.c
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
2 warnings generated.
linking shared-object socket.bundle
linking shared-object openssl.bundle
linking shared-object ripper.bundle
./revision.h unchanged
linking ruby
make[1]: Nothing to be done for `note'.
Generating RDoc documentation
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /var/folders/yq/0qgh9s2s3mv9mj8qcr1tndk00000gn/T/ruby-build.20210117184954.54049.ZDBDN6/ruby-2.7.2/ruby
Reason: image not found
make: *** [rdoc] Abort trap: 6

Don't know how to fix the issue. Thank you in advance!

@iharkatkavets
Copy link
Author

The issue happens with any version of ruby I select to install

@hsbt hsbt transferred this issue from rbenv/rbenv Jan 18, 2021
@jaredbeck
Copy link

dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Reason: image not found

I fixed this by installing gmp with brew.

Background

It's unclear to me whether gmp is a dependency of ruby or not. It is not mentioned in the ruby-build docs, under
Suggested build environment
.

It seems that when ruby is compiled, it will "opportunistically" link against gmp. This can be disabled with the configure script's --without-gmp option. In fact, this is what homebrew's ruby package does, as of Sep. 2019 (Homebrew/homebrew-core#43841)

Looking at the source of bin/ruby-build, the string "gmp" does not appear, so probably @hsbt et. al. have not made an explicit decision about whether to use the --without-gmp option yet.

@apurvis
Copy link

apurvis commented Nov 9, 2021

having similar issue installing ruby 2.6.6 on big sur 11.6 w/m1 chip, though my last 10 log lines are different. strange because around a month ago i was able to successfully install 2.7.4 via rbenv install.

Last 10 log lines:
6 warnings generated.
compiling ../.././ext/psych/yaml/parser.c
5 warnings generated.
422 warnings generated.
linking shared-object date_core.bundle
4 warnings generated.
linking shared-object zlib.bundle
1 warning generated.
linking shared-object psych.bundle
make: *** [build-ext] Error 2

in the logs i also found this actual error level message:

closure.c:264:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);

(i already had gmp installed so the fix above does not work for me)

update: seems related to this issue

@rbenv rbenv locked and limited conversation to collaborators Dec 26, 2021
@hsbt hsbt converted this issue into discussion #1870 Dec 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants