Heroku上的AnyCable和`ActionController :: RoutingError(没有路由与[GET]“ / cable”相匹配)错误

时间:2019-12-29 22:42:16

标签: ruby-on-rails heroku actioncable

我一直在尝试通过Rails应用设置AnyCable,但是我似乎无法诊断出这些/ cable错误的原因:

29 Dec 2019 14:29:55.526296 <158>1 2019-12-29T22:29:53.064510+00:00 heroku router - - at=info method=GET path="/cable" host=www.site.com request_id=### fwd="###.##.##.##" dyno=web.1 connect=1ms service=10ms status=404 bytes=1789 protocol=https
29 Dec 2019 14:29:55.723160 <190>1 2019-12-29T22:29:53.059240+00:00 app web.1 - - Started GET "/cable" for ###.##.##.## at 2019-12-29 22:29:53 +0000
29 Dec 2019 14:29:55.723159 <190>1 2019-12-29T22:29:53.061855+00:00 app web.1 - - ActionController::RoutingError (No route matches [GET] "/cable"):
29 Dec 2019 14:29:55.723204 <190>1 2019-12-29T22:29:53.061986+00:00 app web.1 - - vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
29 Dec 2019 14:29:55.723217 <190>1 2019-12-29T22:29:53.061990+00:00 app web.1 - - vendor/bundle/ruby/2.5.0/gems/newrelic_rpm-6.7.0.359/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'

我在开发和生产中都得到了一些版本,并且我遵循了在发球台上设置AnyCable on Heroku的文档(除非我在某处错过了错字?)

宝石文件

gem "anycable-rails"

config / cable.yml

development:
 adapter: any_cable
production:
 adapter: any_cable

config / anycable.yml

development:
 redis_url: redis://localhost:6379/1
 access_logs_disabled: true
production:
 redis_url: <%= ENV.fetch("REDIS_URL") %>
 access_logs_disabled: true

config / environments / production.rb

config.action_cable.url = 'wss://site.com/cable'

曾经在我的 routes.rb 文件中安装了/cable,但是AnyCable并不需要。因此,我已将其注释掉:

# mount ActionCable.server => '/cable'

是什么导致此不间断路由错误?极度迷失。谢谢!!!

0 个答案:

没有答案