복붙노트

[REDIS] 로컬 가입 액션 케이블,하지만 Heroku가에

REDIS

로컬 가입 액션 케이블,하지만 Heroku가에

나는 온라인으로 찾을 수있는 모든 것을하려고했는데, 아무것도 작동하지 않습니다. 신선한 눈을 기대하면 문제가 표시됩니다. 이 ActionCable를 사용하여 내 처음이며, Heroku가에 밀어 때 모든 위대한 로컬로 작동하지만. 내 로그는 내 dev에 서버와 같은 어떤 actioncable 구독을 표시하지 않습니다 :

[ActionCable] [email@email.com] MsgsChannel is streaming from msg_channel_34

나는 수신 방법에 액세스되지 않는 것을 의미 같은데요있는 /라는, 그들은 추가되지 않고 : 메시지를 보낼 때, 나는 msg_channel_34에 [ActionCable] 방송을 볼 수 있습니까?

//0.0.0.0 : 5000 DEV로 로컬 호스트에서 수신 대기 : 3000 내가 Heroku가의 로그는 TCP에 듣기 말한다에 통지를 할. 어떻게 든 내 Heroku가 응용 프로그램으로 pointnig해야 하는가?

여기에 관련 설정 파일은 다음과 같습니다 :

Procfile :

web: bundle exec puma -p 5000  ./config.ru  
actioncable: bundle exec puma -p 28080  cable/config.ru  
redis: redis-server  

*** 아래의 의견 덕분에, 나 또한 노력하고 있습니다. 여전히 작동,하지만 난 볼 수없는이이 변화를 듣고 있어요 포트, 내가 그것을 구성과 함께 할 수있는 뭔가가 생각하고? :

web: bundle exec puma -p $PORT  ./config.ru  
actioncable: bundle exec puma -p $PORT  cable/config.ru  
redis: redis-server  

/cable/config.ru

require ::File.expand_path('../../config/environment',  __FILE__)  
Rails.application.eager_load!

ActionCable.server.config.allowed_request_origins = ["http://localhost:3000"]  
run ActionCable.server 

설정 / 환경 / development.rb

config.action_cable.allowed_request_origins = ['localhost:3000']
config.action_cable.url = "ws://localhost:3000/cable"

설정 / 환경 / production.rb

config.web_socket_server_url = "wss://app-name.herokuapp.com/cable" 
  config.action_cable.allowed_request_origins = ['https://app-name.herokuapp.com', 'http://app-name.herokuapp.com']

설정 / cable.yml

local: &local  
  adapter: async
  :url: redis://localhost:6379
  :host: localhost
  :port: 6379
  :timeout: 1
  :inline: true
development: *local  
test: *local


production:
  :url: redis:<%= ENV["REDISTOGO_URL"] %>
  adapter: redis

에게 Heroku의 구성을 실행하여 확인, 설정된

routes.rb

mount ActionCable.server => '/cable'

왜 이런 일이 아니지만에게 Heroku에, 개발에 노력하고 있습니다? 나는 시간 동안 읽어 봤는데,하지만 그것을 알아낼 수 없습니다. 감사합니다!!

최신 정보: Heroku가 로그 :

2017-01-25T20:32:57.329656+00:00 heroku[web.1]: Starting process with command `bundle exec puma -p 5000  ./config.ru`
2017-01-25T20:32:59.600554+00:00 app[web.1]: Puma starting in single mode...
2017-01-25T20:32:59.600574+00:00 app[web.1]: * Version 3.6.2 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
2017-01-25T20:32:59.600575+00:00 app[web.1]: * Min threads: 0, max threads: 16
2017-01-25T20:32:59.600577+00:00 app[web.1]: * Environment: production
2017-01-25T20:33:02.375128+00:00 app[web.1]: profile controller
2017-01-25T20:33:02.588653+00:00 app[web.1]: Use Ctrl-C to stop
2017-01-25T20:33:02.588446+00:00 app[web.1]: * Listening on tcp://0.0.0.0:5000
2017-01-25T20:33:17.681469+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-01-25T20:33:17.681469+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-01-25T20:33:17.862118+00:00 heroku[web.1]: Process exited with status 137
2017-01-25T20:33:57.501746+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-01-25T20:33:57.501908+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-01-25T20:33:57.630071+00:00 heroku[web.1]: Process exited with status 137
2017-01-25T20:33:57.642753+00:00 heroku[web.1]: State changed from starting to crashed

해결법

  1. ==============================

    1.문제는 나의 호스트가 Heroku가 응용 프로그램입니다,하지만 요청은 사용자 정의 도메인에서오고 있었다.

    문제는 나의 호스트가 Heroku가 응용 프로그램입니다,하지만 요청은 사용자 정의 도메인에서오고 있었다.

    해결하다:

    Heroku가의 설정 : 설정 RAILS_HOST "http://www.example.com"

    그리고 production.rb에서 :

    config.action_cable.url = "WSS : // # {ENV [ 'RAILS_HOST']} / 케이블"

  2. ==============================

    2.귀하의 procfile는 포트 28080.에 케이블 / cable.ru와 퓨마를 실행하는 것이 제안도 - 파일 케이블 / config.ru이 줄을 포함 할 수 없습니다 :

    귀하의 procfile는 포트 28080.에 케이블 / cable.ru와 퓨마를 실행하는 것이 제안도 - 파일 케이블 / config.ru이 줄을 포함 할 수 없습니다 :

    ActionCable.server.config.allowed_request_origins = ["http://localhost:3000"]  
    

    이미 설정 / 환경이 구성 / *. RB

  3. ==============================

    3.앱 이름은 말 그대로 앱 이름인가? 그럴 생각한다. 확율이 값이 꽤 좋은 ...

    앱 이름은 말 그대로 앱 이름인가? 그럴 생각한다. 확율이 값이 꽤 좋은 ...

    config.web_socket_server_url = "wss://app-name.herokuapp.com/cable" 
    config.action_cable.allowed_request_origins = ['https://app-name.herokuapp.com', 'http://app-name.herokuapp.com']
    

    필요는 연결하려는 실제 대중을 향한 URL을 사용하도록 업데이트합니다.

  4. ==============================

    4.저도 같은 문제가 있고, 여기에 필요한 해답을 발견 : 보석 4+ 호환성 레디 스 "특정 동작 케이블 pubsub 어댑터 '레디 스'를,하지만 보석이로드되지 않습니다." 나는 3.1.0 내 레디 스를 다운 그레이드하면 완벽했다.

    저도 같은 문제가 있고, 여기에 필요한 해답을 발견 : 보석 4+ 호환성 레디 스 "특정 동작 케이블 pubsub 어댑터 '레디 스'를,하지만 보석이로드되지 않습니다." 나는 3.1.0 내 레디 스를 다운 그레이드하면 완벽했다.

  5. from https://stackoverflow.com/questions/41860718/action-cable-subscribing-locally-but-not-on-heroku by cc-by-sa and MIT license