Last active
December 14, 2017 15:56
-
-
Save jsheridanwells/f7b8b91ca6918078a33846b0bc1eb718 to your computer and use it in GitHub Desktop.
Deploying ActionCable with Redis to Heroku (according to Michael Hartl)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. install redis gem file: | |
gemfile.rb -> gem 'redis', '3.3.1' | |
2. bundle install | |
3. include redistogo addon: | |
$ heroku addons:create redistogo | |
(may have to set it up in heroku account dashboard???) | |
4. update cable.yml: | |
production: | |
adapter: redis | |
url: redis://localhost:6379/1 | |
5. pipe the result of heroku config to grep: | |
$ heroku config | grep REDISTOGO_URL | |
(sample output): | |
REDISTOGO_URL: redis://redistogo:[email protected]:9426/ | |
6. update cable.yml w/ reditogo url: | |
(sample) | |
production: | |
adapter: redis | |
url: redis://redistogo:[email protected]:9426/ | |
7. config production.rb (sample) | |
config.action_cable.url = 'wss://peaceful-basin-31856.herokuapp.com/cable' | |
config.action_cable.allowed_request_origins = [ | |
'https://localhost:8080', /http:\/\/localhost:8080.*/ ] | |
8. You may need to restart heroku dynos if making changes: | |
$ heroku restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment