発生している問題
OSをMontereyにアップデートしたところ、以前作成したプログラムを実行できなくなりました。
エラーメッセージ
[WARNING] Could not load command "rails/commands/server/server_command". Error: uninitialized constant URI::Generic.
該当のソースコード
[WARNING] Could not load command "rails/commands/server/server_command". Error: uninitialized constant URI::Generic. /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/ftp.rb:23:in `<module:URI>' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/ftp.rb:13:in `<top (required)>' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:107:in `<top (required)>' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/rfc2396_parser.rb:13:in `<top (required)>' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/common.rb:13:in `<top (required)>' /Users/takumi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
試したこと
OSのアップデートによりRubyのverが変わってしまったことが原因かと思い、Rubyとrbenvのバージョンを確認しました。
また以前利用していた2.5.0にダウングレードし実行を試しました。
補足情報(FW/ツールのバージョンなど)
ruby 2.5.0p0 (2017-12-25 revision 61468) x86_64-darwin19
rbenv 1.2.0
回答1件
あなたの回答
tips
プレビュー