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

rbenv install 3.0.2 fails on macOS Big Sur 11.6 (20G165) #1801

Closed
phirk opened this issue Sep 29, 2021 · 9 comments
Closed

rbenv install 3.0.2 fails on macOS Big Sur 11.6 (20G165) #1801

phirk opened this issue Sep 29, 2021 · 9 comments

Comments

@phirk
Copy link

phirk commented Sep 29, 2021

rbenv install 3.0.2 fails on macOS Big Sur 11.6 (20G165):

➜ rbenv install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.6 using ruby-build 20210925)

Inspect or clean up the working tree at /var/folders/n5/99pd__cd4hldsmzrcr6zyr600000gp/T/ruby-build.20210929113846.45344.8kAFvG
Results logged to /var/folders/n5/99pd__cd4hldsmzrcr6zyr600000gp/T/ruby-build.20210929113846.45344.log

Last 10 log lines:
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/rob/.rbenv/versions/3.0.2
  --enable-shared
  --with-readline-dir=/usr/local/opt/readline
  --with-openssl-dir=/usr/local/opt/openssl@1.1
  CC=clang
  LDFLAGS=-L/Users/rob/.rbenv/versions/3.0.2/lib
  CPPFLAGS=-I/Users/rob/.rbenv/versions/3.0.2/include

Full log: https://gist.github.com/phirk/c0e6920602f6a3716de4cb99c30e6adc

@phirk
Copy link
Author

phirk commented Sep 29, 2021

Note: these (required) libraries are all installed by Homebrew:

  • openssl@1.1
  • readline
  • libyaml

@soffes
Copy link

soffes commented Oct 6, 2021

I was having a similar issue because I accidentally installed openssl@3. This fixed it for me:

$ brew install openssl@1.1
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl@1.1`" rbenv install 3.0.2

(If this doesn't work, try getting the value of brew --prefix openssl@1.1 and using that directly instead.)

@minhtienvu
Copy link

minhtienvu commented Oct 18, 2021

I have the same issue when I try to install 3.0.2 verssion.

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/openssl@1.1" rben
v install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
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/kg/jgp0sjw16pg5j3lmp9yq9_140000gn/T/ruby-build.20211018170536.62572.B2UNRu
Results logged to /var/folders/kg/jgp0sjw16pg5j3lmp9yq9_140000gn/T/ruby-build.20211018170536.62572.log

Last 10 log lines:
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking whether it is Android... no
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/vuminhtien/.rbenv/versions/3.0.2/lib "
make: *** No targets specified and no makefile found.  Stop.

@briancolfer
Copy link

What worked for me ... first uninstall the existing 3.0.2 then reinstall with the above options.

@shelbykohring
Copy link

I was having a similar issue because I accidentally installed openssl@3. This fixed it for me:

$ brew install openssl@1.1
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/openssl@1.1" rbenv install 3.0.2

Note: I'm on an M1. You'll need to change the path from /opt to /usr/local if you are using Intel.

I am running into this issue on Mac OS 12.0.1 Monterey using Intel. Unsure with '/opt' path should be changed to 'usr/local' .

Have tried changing the first one, then tried the second one, then tried them both. Nothing is resolving this issue for me. Anyone have success installing Ruby 3.0.2 on Monterey?

@soffes
Copy link

soffes commented Nov 9, 2021

@shelbykohring updated my comment. Hope that helps!

@edmundask
Copy link

edmundask commented Nov 12, 2021

I have the same issue when I try to install 3.0.2 verssion.

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/openssl@1.1" rben
v install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
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/kg/jgp0sjw16pg5j3lmp9yq9_140000gn/T/ruby-build.20211018170536.62572.B2UNRu
Results logged to /var/folders/kg/jgp0sjw16pg5j3lmp9yq9_140000gn/T/ruby-build.20211018170536.62572.log

Last 10 log lines:
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking whether it is Android... no
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/vuminhtien/.rbenv/versions/3.0.2/lib "
make: *** No targets specified and no makefile found.  Stop.

@minhtienvu the problem for me was the following line:

export LIBRARY_PATH="${LD_LIBRARY_PATH:+LD_LIBRARY_PATH:}/usr/local/opt/openssl/lib/"

I have openssl installed via homebrew, so commenting this line out inside .zshrc, .bash_profile, .zprofile may help. Note that this line is somewhat custom on my setup, but you may have something similar. I'm running Monterey 12.0.1 on the new MacBook Pro 16" M1, btw.

@a-sh-dev
Copy link

a-sh-dev commented Nov 16, 2021

rbenv install 3.0.2 fails on macOS Big Sur 11.6 (20G165):

➜ rbenv install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.6 using ruby-build 20210925)

Inspect or clean up the working tree at /var/folders/n5/99pd__cd4hldsmzrcr6zyr600000gp/T/ruby-build.20210929113846.45344.8kAFvG
Results logged to /var/folders/n5/99pd__cd4hldsmzrcr6zyr600000gp/T/ruby-build.20210929113846.45344.log

Last 10 log lines:
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/rob/.rbenv/versions/3.0.2
  --enable-shared
  --with-readline-dir=/usr/local/opt/readline
  --with-openssl-dir=/usr/local/opt/openssl@1.1
  CC=clang
  LDFLAGS=-L/Users/rob/.rbenv/versions/3.0.2/lib
  CPPFLAGS=-I/Users/rob/.rbenv/versions/3.0.2/include

Full log: https://gist.github.com/phirk/c0e6920602f6a3716de4cb99c30e6adc

I have the same exact issue with the same error message.
Tried the normal rbenv install 3.0.2, but was unsuccessful.
Tried CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 3.0.2 based on this article.

I also have the openssl@1.1 installed and running macOS Big Sur 11.2.3.

Tried running the suggested

RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl@1.1`" rbenv install 3.0.2

but unfortunately still unsuccessful and I got the same error as OP.

@a-sh-dev
Copy link

So, I updated my BigSur to 11.6.1 (20G224), which includes xcode CLT 13 also installed through the software update) until no more update was available in the list except for the macOS Monterey upgrade option.

Restarted my MacBook, and tried to run rbenv install 3.0.2, and it somehow was installed successfully...

I'm not sure if it's part of the reason, but prior to that, I ran brew doctor and brew cleanup and found issues with my node not brew linked due to non-brew installation previously... although this node linking issue hasn't been resolved yet, the rbenv ruby installation on version 3.0.2 was successful.

@rbenv rbenv locked and limited conversation to collaborators Dec 26, 2021
@hsbt hsbt converted this issue into discussion #1866 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

7 participants