前提・実現したいこと
lxcのコンテナで仮想環境を作り、Rubyのバージョン2.7.2から2.7.4へのアップデートができるか検証をしています。
アップデート自体は問題なく終了し、サーバーも起動した(はず)のですが、unicorn.logを確認してみると
以下のWarningが発生していました。
このサーバを起動する度に出てくるこのエラーを無くしたいです。
/home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/version.rb:4: warning: already initialized constant JSON::VERSION /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/version.rb:3: warning: previous definition of VERSION was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/version.rb:5: warning: already initialized constant JSON::VERSION_ARRAY /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/version.rb:4: warning: previous definition of VERSION_ARRAY was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/version.rb:6: warning: already initialized constant JSON::VERSION_MAJOR /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/version.rb:5: warning: previous definition of VERSION_MAJOR was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/version.rb:7: warning: already initialized constant JSON::VERSION_MINOR /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/version.rb:6: warning: previous definition of VERSION_MINOR was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/version.rb:8: warning: already initialized constant JSON::VERSION_BUILD /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/version.rb:7: warning: previous definition of VERSION_BUILD was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/common.rb:100: warning: already initialized constant JSON::NaN /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/common.rb:99: warning: previous definition of NaN was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/common.rb:102: warning: already initialized constant JSON::Infinity /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/common.rb:101: warning: previous definition of Infinity was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/common.rb:104: warning: already initialized constant JSON::MinusInfinity /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/common.rb:103: warning: previous definition of MinusInfinity was here /home/---/.rbenv/versions/2.7.4/lib/ruby/2.7.0/json/common.rb:129: warning: already initialized constant JSON::Unparser Error /home/---/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/json-1.8.6/lib/json/common.rb:128: warning: previous definition of UnparserError was here I, [2021-08-17T02:55:08.323252 #16083] INFO -- : listening on addr=0.0.0.0:3000 fd=7 I, [2021-08-17T02:55:08.332895 #16087] INFO -- : worker=0 ready I, [2021-08-17T02:55:08.334772 #16088] INFO -- : worker=1 ready I, [2021-08-17T02:55:08.336756 #16083] INFO -- : master process ready I, [2021-08-17T02:55:08.336929 #16090] INFO -- : worker=2 ready I, [2021-08-17T02:55:08.338726 #16092] INFO -- : worker=3 ready I, [2021-08-17T02:55:08.340373 #16093] INFO -- : worker=4 ready I, [2021-08-17T02:56:17.374186 #16083] INFO -- : reaped #<Process::Status: pid 16092 exit 0> worker=3 I, [2021-08-17T02:56:17.374347 #16083] INFO -- : reaped #<Process::Status: pid 16093 exit 0> worker=4 I, [2021-08-17T02:56:17.474896 #16083] INFO -- : reaped #<Process::Status: pid 16087 exit 0> worker=0 I, [2021-08-17T02:56:17.475046 #16083] INFO -- : reaped #<Process::Status: pid 16088 exit 0> worker=1 I, [2021-08-17T02:56:17.475109 #16083] INFO -- : reaped #<Process::Status: pid 16090 exit 0> worker=2 I, [2021-08-17T02:56:17.475190 #16083] INFO -- : master complete I, [2021-08-17T02:56:37.593762 #16190] INFO -- : Refreshing Gem list
試したこと
JSONの前のバージョンが既に存在しているエラーということで、以下URLを参考に
Bundle clean --force
→bundle
コマンドを実行しました。
しかし、同様のエラーが発生してしまいます。
URLに書かれているbundle clean --force && bundle update --force
も実施しましたがunicornが起動しませんでした。
補足情報(FW/ツールのバージョンなど)
ruby 2.7.2→2.7.4
CentOS7
アップデート手順としては
rbenv install 2.7.4
rbenv global 2.7.4
Gemfile及びlockのバックアップ及び、bundle install
その後 bundle clean --force
bundle
あなたの回答
tips
プレビュー