INFO -- : Refreshing Gem list
LoadError: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found
Overview
表題のエラーが発生してunicornが起動できない、
再現:
INFO -- : Refreshing Gem list
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
上記エラーが発生して、nodejsをインストールしたが、表題のエラーが発生しました。
環境:
OS centos 6.9
Ruby 2.5.0
rails 5.2.1
gcc 7.8.0
要するに現状の環境下では CXXABI_1.3.9 左記が含まれていないとのことなので
含まれているものをさがす・
下記がエラー発生時のログである。
[2018-11-11T10:14:08.054878 #9573] INFO -- : Refreshing Gem list
LoadError: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/therubyracer-0.12.3/lib/v8/init.so) - /home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/therubyracer-0.12.3/lib/v8/init.so
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/therubyracer-0.12.3/lib/v8.rb:4:in `<main>'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/therubyracer-0.12.3/lib/therubyracer.rb:1:in `<main>'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `each'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:76:in `block in require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `each'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/runtime.rb:65:in `require'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:114:in `require'
/usr/share/nginx/html/config/application.rb:7:in `<top (required)>'
/usr/share/nginx/html/config/environment.rb:2:in `require_relative'
/usr/share/nginx/html/config/environment.rb:2:in `<top (required)>'
config.ru:4:in `require_relative'
config.ru:4:in `block in <main>'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn.rb:56:in `eval'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn.rb:56:in `block in builder'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:139:in `block in rails_builder'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:795:in `build_app!'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:139:in `start'
/home/vagrant/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.5.0/bin/unicorn_rails:23:in `load'
/home/vagrant/.rbenv/versions/2.5.0/bin/unicorn_rails:23:in `<top (required)>'
要するに下記方法にてバージョンを確認し、それであれば動くとのこと
$ strings /usr/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
rails の出力したログ通り、バージョンが違うので、それを内包したものを探す。
私の場合gcc 7.8.0を入れてあるので、それの標準ライブラリーを使うことにしました。
$ strings /usr/local/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9 <-- (☝︎ ՞ਊ ՞)☝︎ ありました。
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_TM_1
CXXABI_FLOAT128
こちらのライブラリーに切り替えることにしました。
$ sudo cp /usr/local/lib64/libstdc++.so.6 /usr/lib64/
$ strings /usr/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_TM_1
CXXABI_FLOAT128
私の場合そのままコピーしちゃいます。
本当は参照先を変更し、丸ごと置換の方が方が良さそうですが、
これでとりあえずは動きます。