0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【rbenv】`rbenv install 3.1.0`実行時の`BUILD FAILED`を解消した方法【Ruby】【Rails】

Last updated at Posted at 2022-02-18

##rbenv install 3.1.0実行時のBUILD FAILEDを解消した方法

状況

M1 macで以前にRuby 2.7.5をインストールしていました。
OSを11.6.4(Big Sur)から12.2.1(Monterey)にバージョンアップした後にRubyをバージョンアップするために、rbenv install 3.1.0を実行した際に、以下のエラーが出てインストールができませんでした。

ターミナル
$ rbenv install 3.1.0
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...

BUILD FAILED (macOS 12.2.1 using ruby-build 20211227)

Inspect or clean up the working tree at /var/folders/8z/why2366147x1h2j9jtf0000gn/T/ruby-build.2022180259.98949.4ygKJM
Results logged to /var/folders/8z/why2366147x1h2jzhrw0000gn/T/ruby-build.2022090259.949.log

Last 10 log lines:
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

解決した方法

以下の通り対応することでエラーが解消し、インストールすることができました。

ターミナル
$ brew upgrade rbenv ruby-build
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.

Error: No developer tools installed.
Install the Command Line Tools:
  xcode-select --install

$ xcode-select --install
xcode-select: note: install requested for command line developer tools

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

$ brew upgrade rbenv ruby-build

$ rbenv install 3.1.0
     
$ rbenv global 3.1.0           
$ ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21]

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?