本番環境のrubyを2.6
から2.7
にバージョンアップしようとしています。
一気にgemをupdateせず、circleciを使用してlintとrspecがこける都度、該当のgemをupdateすることをエラーが起きなくなるまで繰り返すというような変更作業を行なっています。
その中で以下のエラーを解決できずにいます。
LoadError: Unable to autoload constant CaseReports::FavoritesAPI, expected /home/circleci/***/app/api/web/case_reports/favorites_api.rb to define it /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:511:in `load_missing_constant' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:195:in `const_missing' /home/circleci/***/app/api/app/v2.rb:13:in `<class:V2>' /home/circleci/***/app/api/app/v2.rb:1:in `<main>' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:378:in `block in require_or_load' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive' /home/circleci/***/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
エラー箇所はapp/api/app/v2.rb
内ですが、これまで本番アプリケーションでもApp::V2::CaseReports::FavoritesAPI
として動作しておりましたが、update作業の中で定数がうまく読まれないようになったようです。
# v2.rb . . . mount App::V2::BannersAPI mount App::V2::BlockingsAPI mount App::V2::CaseReports::FavoritesAPI mount App::V2::CaseReports::ClipAPI mount App::V2::CaseReportsAPI mount App::V2::ClinicGroupsAPI . . .
どなたか知恵を貸しいただけませんでしょうか。
update作業の概要を以下にまとめておきます。
- circleciで用いるimageを
ruby:2.6.0-node-browsers
からruby:2.7.0-node-browsers
に変更
lint: working_directory: ~/*** resource_class: large docker: - image: circleci/ruby:2.7.0-node-browsers
- エラーの原因となっているgemをupdate
- update bundler
- update bootsnap
- update shoulda-matchers
- update config
- update capybara
- update grape ← ここから先に進めないです
あなたの回答
tips
プレビュー