0

と を使用ruby 3.1.0p0してRails 7.0.1います。Rails 6.1最近とからアップグレードしましたruby 2.7

サイトをローカルでホストすると、問題は発生しません。しかし、サイトをUbuntu 20.04サーバーに展開するとnginx v1.18.0、サイトの読み込みに失敗し、次のエラーが表示されます。

NoMethodError: undefined method `glob?' for nil:NilClass
 path.ast.glob?

[GEM_ROOT]/gems/actionpack-7.0.1/lib/action_dispatch/journey/route.rb:138:in `glob?' の 138 行目で発生します。

誰もこのような状況に遭遇したことがありますか? それは本当に奇妙に思えます。それを解決するために何をする必要があるのか​​ わかりません。

編集:

ステージングとプロダクションをローカルでテストすることにしました。私が行った場合

RAILS_ENV=staging bin/rails sまた RAILS_ENV=production bin/rails s

ローカル マシンでも同じエラーが発生します。そのため、開発環境で実行されていないときにのみ発生することが起こっています。

完全なスタック トレースは次のとおりです。

I, [2022-01-24T05:42:38.843002 #29967]  INFO -- : [d3fbd988-67a8-461f-8d7f-26f83a67426f] Started GET "/" for 23.81.176.249 at 2022-01-24 05:42:38 -0800
I, [2022-01-24T05:42:38.843604 #29967]  INFO -- : [d3fbd988-67a8-461f-8d7f-26f83a67426f] Processing by HomeController#landing as HTML
F, [2022-01-24T05:42:38.846258 #29967] FATAL -- : [d3fbd988-67a8-461f-8d7f-26f83a67426f]
[d3fbd988-67a8-461f-8d7f-26f83a67426f] NoMethodError (undefined method `glob?' for nil:NilClass

        path.ast.glob?
                ^^^^^^):
[d3fbd988-67a8-461f-8d7f-26f83a67426f]
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/route.rb:138:in `glob?'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rails/app.rb:48:in `block (2 levels) in recognize_route'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:74:in `block in recognize'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:66:in `each'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:66:in `recognize'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rails/app.rb:35:in `block in recognize_route'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rails/app.rb:34:in `each'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rails/app.rb:34:in `recognize_route'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rails/action_controller_route_subscriber.rb:20:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:236:in `finish'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:76:in `block in finish'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:91:in `block in iterate_guarding_exceptions'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:90:in `each'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:90:in `iterate_guarding_exceptions'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/fanout.rb:76:in `finish'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/instrumenter.rb:49:in `finish_with_state'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications/instrumenter.rb:30:in `instrument'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/notifications.rb:206:in `instrument'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_controller/metal/instrumentation.rb:64:in `process_action'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activerecord (7.0.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/abstract_controller/base.rb:151:in `process'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionview (7.0.1) lib/action_view/rendering.rb:39:in `process'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_controller/metal.rb:188:in `dispatch'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_controller/metal.rb:251:in `dispatch'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:32:in `each'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/journey/router.rb:32:in `serve'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/routing/route_set.rb:850:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/etag.rb:27:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/head.rb:12:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/cookies.rb:693:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/callbacks.rb:99:in `run_callbacks'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rack/middleware.rb:34:in `call!'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] airbrake (12.0.0) lib/airbrake/rack/middleware.rb:23:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] railties (7.0.1) lib/rails/rack/logger.rb:36:in `call_app'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] railties (7.0.1) lib/rails/rack/logger.rb:25:in `block in call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/tagged_logging.rb:37:in `tagged'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] activesupport (7.0.1) lib/active_support/tagged_logging.rb:99:in `tagged'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] railties (7.0.1) lib/rails/rack/logger.rb:25:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/method_override.rb:24:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/runtime.rb:22:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] actionpack (7.0.1) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] honeybadger (4.10.0) lib/honeybadger/rack/error_notifier.rb:33:in `block in call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] honeybadger (4.10.0) lib/honeybadger/agent.rb:426:in `with_rack_env'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] honeybadger (4.10.0) lib/honeybadger/rack/error_notifier.rb:30:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] honeybadger (4.10.0) lib/honeybadger/rack/user_feedback.rb:31:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] honeybadger (4.10.0) lib/honeybadger/rack/user_informer.rb:21:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] railties (7.0.1) lib/rails/engine.rb:530:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/configuration.rb:249:in `call'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/request.rb:77:in `block in handle_request'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/request.rb:76:in `handle_request'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/server.rb:447:in `process_client'
[d3fbd988-67a8-461f-8d7f-26f83a67426f] puma (5.5.2) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
4

0 に答える 0