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.
質問
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?
解決
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.
他のヒント
require 'rubygems'
on the top of your faye.ru
(before the require 'faye'
) will probably resolve this.
For my case, just add bundle exec
before the command and it worked.
bundle exec rackup faye.ru -E production -s thin