Ruby2.7.3を入れる(未解決)

プログラム

解決編 → ruby2-7-3を入れる

Rubyを入れるのにいくらかてこずったのでメモ

まず git

yum install -y git

次に Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

最後の方でこんな感じにいわれるのでそれ通りに対応。>>赤字のコマンドを実行

Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /root/.bash_profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo yum groupinstall 'Development Tools'
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

使えるか確認

rbenv --version

Ruby2.7.3をインストール

rbenv install 2.7.3

こんな感じに怒られる

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

BUILD FAILED (CentOS Linux 8 using ruby-build 20220125)

Inspect or clean up the working tree at /tmp/ruby-build.20220127144843.9882.h2zn4R
Results logged to /tmp/ruby-build.20220127144843.9882.log

ログファイルの中を見るとこんな感じ

./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --rdoc-output=".ext/rdoc" --html-output=".ext/html"
/tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require': /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/.ext/x86_64-linux/openssl.so: undefined symbol: EC_GROUP_new_curve_GF2m, version OPENSSL_1_1_0 - /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/.ext/x86_64-linux/openssl.so (LoadError)
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/.ext/common/openssl.rb:13:in `<top (required)>'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/security.rb:12:in `<top (required)>'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/package.rb:44:in `<top (required)>'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/installer.rb:11:in `<top (required)>'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127144843.9882.h2zn4R/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from ./tool/rbinstall.rb:713:in `<module:RbInstall>'
        from ./tool/rbinstall.rb:649:in `<main>'
make: *** [uncommon.mk:373: do-install-all] Error 1

OpenSSL関連でエラーが出てそう。OpenSSLを再インストールしてみる。

brew install openssl

実行中のログ

Running `brew update --preinstall`...
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 3 formulae.

==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.0.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:51f292234a6a9933673d4afbf6ee98e676c1d523ec2316b49425c45d55e7471c
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:51f292234a6a9933673d4afbf6ee98e676c1d523ec2316b49425c45d55e7471c?se=2022-01-27T15%3A25%3A00Z&sig=izHqoJc9xA1BFwJZHFW3U6FPELY
######################################################################## 100.0%
==> Pouring openssl@3--3.0.1.x86_64_linux.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /home/linuxbrew/.linuxbrew/etc/openssl@3/certs

and run
  /home/linuxbrew/.linuxbrew/opt/openssl@3/bin/c_rehash

openssl@3 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because it conflicts with the `openssl@1.1` formula.

If you need to have openssl@3 first in your PATH, run:
  echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/openssl@3/bin:$PATH"' >> /root/.bash_profile

For compilers to find openssl@3 you may need to set:
  export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/openssl@3/lib"
  export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/openssl@3/include"

For pkg-config to find openssl@3 you may need to set:
  export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/openssl@3/lib/pkgconfig"

==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/openssl@3/3.0.1: 6,751 files, 36MB
==> Running `brew cleanup openssl@3`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

もっかいRuby2.7.3をインストール

rbenv install 2.7.3

また怒られる

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

BUILD FAILED (CentOS Linux 8 using ruby-build 20220125)

Inspect or clean up the working tree at /tmp/ruby-build.20220127151934.26569.5IgRSu
Results logged to /tmp/ruby-build.20220127151934.26569.log

ログファイルの中

./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --rdoc-output=".ext/rdoc" --html-output=".ext/html"
/tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require': /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/.ext/x86_64-linux/openssl.so: undefined symbol: EC_GROUP_new_curve_GF2m, version OPENSSL_1_1_0 - /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/.ext/x86_64-linux/openssl.so (LoadError)
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/.ext/common/openssl.rb:13:in `<top (required)>'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/security.rb:12:in `<top (required)>'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/package.rb:44:in `<top (required)>'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/installer.rb:11:in `<top (required)>'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from /tmp/ruby-build.20220127151934.26569.5IgRSu/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
        from ./tool/rbinstall.rb:713:in `<module:RbInstall>'
        from ./tool/rbinstall.rb:649:in `<main>'
make: *** [uncommon.mk:373: do-install-all] Error 1

また同じエラー…

コメント

タイトルとURLをコピーしました