I have the following code in config/initializers/faye.rb
:
require 'faye'
Faye::WebSocket.load_adapter('puma')
faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
Rails.application.config.middleware.insert_before Rack::Runtime, faye_server
When trying to start the server, I get this:
undefined method 'new' for an instance of Faye::RackAdapter (NoMethodError)
However, I can run irb
and then the above lines of code without issues.
I suspect I don’t understand something about initializers. What am I missing?