Skip to content
Branch: master
Go to file

GitPitch Gem Version Build Gitter Documentation

AnyCable Rails

AnyCable allows you to use any WebSocket server (written in any language) as a replacement for built-in Rails Action Cable server.

With AnyCable you can use channels, client-side JS, broadcasting - (almost) all that you can do with Action Cable.

You can even use Action Cable in development and not be afraid of compatibility issues.

Important This is a readme for the upcoming v1.0 release. For v0.6.x see the readme from the 0-6-stable branch.

📑 Documentation.

Sponsored by Evil Martians


  • Ruby >= 2.5
  • Rails >= 5.2
  • Redis (see other options for broadcasting)


Add anycable-rails gem to your Gemfile:

gem "anycable-rails"

# when using Redis broadcast adapter
gem "redis", ">= 4.0"

Interactive set up

After the gem was installed, you can run an interactive wizard to configure your Rails application for using with AnyCable by running a generator:

bundle exec rails g anycable:setup

Manual set up

Specify AnyCable subscription adapter for Action Cable:

# config/cable.yml
  adapter: any_cable # or anycable

  adapter: any_cable

and specify AnyCable WebSocket server URL:

# For development it's likely the localhost

# config/environments/development.rb
config.action_cable.url = "ws://localhost:3334/cable"

# For production it's likely to have a sub-domain and secure connection

# config/environments/production.rb
config.action_cable.url = "wss://"

Then, run AnyCable RPC server:

$ bundle exec anycable

# don't forget to provide Rails env

$ RAILS_ENV=production bundle exec anycable

And, finally, run AnyCable WebSocket server, e.g. anycable-go:

anycable-go --host=localhost --port=3334

See documentation for more information on AnyCable + Rails usage.

Action Cable Compatibility

See documentation.


Bug reports and pull requests are welcome on GitHub at


If you are familiar with Docker, you can use DIP to start developing the gem quickly.


The gem is available as open source under the terms of the MIT License.

Security Contact

To report a security vulnerability, please contact us at We will coordinate the fix and disclosure.

You can’t perform that action at this time.