anycable / anycable-rails

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

undefined method `camelize' for :any_cable:Symbol #106

Closed christianvargasforero closed 4 years ago

christianvargasforero commented 4 years ago

Hello,

I have the following problem, every time I go to do a brodcast I get the following message: "undefined method `camelize' for :any_cable:Symbol"

Captura de Pantalla 2019-10-16 a la(s) 6 11 23 p  m

I tried in console and in the app and in both cases I have the same problem, any suggestions? Thank you!!

Ruby version: 2.4.4 Rails version: 5.2.1 anycable gem version: 0.6.3 anycable-rails gem version: 0.6.4 grpc gem version: gRPC version: 1.24.0

sponomarev commented 4 years ago

@christianvargasforero Can you share your stack trace?

christianvargasforero commented 4 years ago

@christianvargasforero Can you share your stack trace?

On execute ADAPTER=any_cable RAILS_ENV=production bundle exec anycable --redis-channel="__anycable__" --server-command="anycable-go --port 3334 --redis_channel=__anycable__" this is the production log:

Captura de Pantalla 2019-10-16 a la(s) 8 41 36 p  m

I see that two errors, one of authorization, and another of the websockekt, this is the configuration that I have:

#config/cable.yml

production: adapter: :any_cable url: redis://localhost:6379 password: <%=ENV['pws']%> redis: &redis adapter: redis url: redis://localhost:6379/1 development: *redis test: adapter: async

#aplication.rb ... Bundler.require(*Rails.groups) require "anycable/rails" ...

#anycable.yml

development: rpc_host: "localhost:50051" redis_url: "redis://localhost:6379/2" access_logs_disabled: false debug: true

production: rpc_host: "localhost:50051" redis_url: "redis://localhost:6379/2" redis_channel: "anycable" access_logs_disabled: false debug: true

#production.rb

config.action_cable.allowed_request_origins = ['https://domain.com', %r{https://#{Socket.gethostname.downcase}.*}] config.action_cable.url = "wss://subdomain.domain.com/cable"

#bin/anycable

require ::File.expand_path('../../config/environment', FILE) require 'anycable-rails' Anycable.configure do |config| config.connection_factory = ActionCable.server.config.connection_class.call end Rails.application.eager_load! Anycable::Server.start

environment.rb

.... AnyCable.connection_factory = ActionCable.server.config.connection_class.call

This is the web console:

Captura de Pantalla 2019-10-16 a la(s) 9 09 19 p  m

Captura de Pantalla 2019-10-16 a la(s) 9 11 14 p  m

rus-max commented 4 years ago

Change the second line in config/cable.yml to adapter: any_cable

christianvargasforero commented 4 years ago

Change the second line in config/cable.yml to adapter: any_cable

Perfect, thank you very much, excuse my carelessness