anycable / anycable-rails

AnyCable for Ruby on Rails applications
https://anycable.io
MIT License
495 stars 35 forks source link

ActionController::RoutingError (No route matches [GET] "/cable") #180

Closed quadlol closed 1 year ago

quadlol commented 1 year ago

I have just installed the anycable-rails gem and I cannot get it working with my current multitenant setup. I am using subdomains, eg. tenant1.localhost:3000

Now, I am seeing a spam in my rails console

Request URL: ws://tenant1.localhost:3000/cable ActionController::RoutingError (No route matches [GET] "/cable"):

This route should/have existed. How can I setup this gem with subdomains?

## dev config
Rails.application.configure do
    config.action_cable.url = ActionCable.server.config.url = ENV.fetch("CABLE_URL", "ws://localhost:8080/cable") if AnyCable::Rails.enabled?
  end

## cable.yml
development:
  adapter: <%= ENV.fetch("ACTION_CABLE_ADAPTER", "any_cable") %>

## Procfile
anycable: bundle exec anycable
ws: anycable-go --port=8080

## consumer
import { createConsumer } from '@rails/actioncable'
export default createConsumer()

Many thanks

Tell us about your environment

Ruby version: 3.1

Rails version: 6.1

anycable gem version: 1.3

anycable-rails gem version: 1.3.7

grpc gem version: 1.52