Search code examples
ruby-on-railsrubyfaye

Rails faye server won't start


I have an Rails application which I am attempting to include the faye ruby gem.
I have installed faye with

gem install faye 

and added a faye.ru to my root rails app. folder:

require 'faye'
Faye::WebSocket.load_adapter('thin')
faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
run faye_server

When I want to start faye with:

rackup -s thin -E production config.ru 

I only get:

`require': cannot load such file -- faye

How do I address this issue?


Solution

  • You need to include it in your Gemfile:

    gem 'faye'
    

    Then run bundle install, this make the gem available to your application.

    Also consider gem 'faye', require: 'faye' to make the loaded gem available to your entire application.