slack-ruby / slack-ruby-bot

The easiest way to write a Slack bot in Ruby.
MIT License
1.12k stars 187 forks source link

Missing concurrency - Add faye-websocket to your gemfile -- It's already in my Gemfile #276

Closed altjx closed 3 years ago

altjx commented 3 years ago

Today when I decided to re-deploy my AWS Stack, I noticed the following error:

root@2197850807bc:/myapp# bundle exec rails c -e production
Running via Spring preloader in process 1065
WARNING: Spring is running in production. To fix this make sure the spring gem is only present in `development` and `test` groups in your Gemfile and make sure you always use `bundl
e install --without development test` in production
Loading production environment (Rails 5.2.4)
irb(main):001:0> Slack::RealTime::Client.new
Traceback (most recent call last):
        2: from (irb):1
        1: from (irb):1:in `new'
Slack::RealTime::Config::NoConcurrencyError (Missing concurrency. Add async-websocket or faye-websocket to your Gemfile.)
irb(main):002:0> exit
root@2197850807bc:/myapp# cat Gemfile | grep faye
gem "faye-websocket"
root@2197850807bc:/myapp#

I can't figure out why this is happening. My Gemfile has stayed the same and nothing in my code has changed at all. The only thing I can think of is possibly one of the gems have been updated and something broke along the way.

Here's what's in my Gemfile:

132 # Slack-ruby-client
133 gem "eventmachine"
134 gem "faye-websocket"
135 gem "rails_best_practices"
136 gem "slack-ruby-client"
137 gem "websocket-driver"
dblock commented 3 years ago

You've upgraded slack-ruby-client to 0.16.0, which removed faye-websocket support in https://github.com/slack-ruby/slack-ruby-client/pull/357 (the error message is misleading, I fixed that in https://github.com/slack-ruby/slack-ruby-client/pull/360).

I would lock back slack-ruby-client at the older version you've had or upgrade to async-websocket.

Note that generally you shouldn't be finding this in your deployment, your gem versions should be locked via Gemfile.lock so you don't have similar surprises with various libraries.