레일, EventMachine 및 async_sinatra를 함께 사용하기위한 환경을 설정하려고하는데 "uncaught"오류가 발생하여 설정이 잘못되었다고 생각합니다. 던지기 : 비동기 ".async_sinatra with Rails EventMachine and Thin
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sinatra'
gem 'async_sinatra'
gem 'execjs'
gem 'therubyracer'
gem 'eventmachine'
gem 'rack-fiber_pool', :require => 'rack/fiber_pool'
gem 'thin'
이것은 config.ru입니다 :
이것은 내가 내 Gemfile에있는 것은 내입니다
match '/longpoll', :to => LongPoll
:
require ::File.expand_path('../config/environment', __FILE__)
use Rack::FiberPool
run Longpoll::Application
내 routes.rb 파일에 무엇을이
이것은 내 long_poll.rb 파일입니다.
class LongPoll < Sinatra::Base
register Sinatra::Async
aget '/longpoll' do
body 'Hello world!'
end
end
이 설치가 작동하지 않는다고 생각하는 아이디어가 있습니까?
편집 : 내가 랙 fiber_pool없이 작업하는 일을 해결되는지 파악
. 누구나 함께 일할 수 있는지 여부를 확인할 수 있습니까?
같은 오류를 범 basic.ru 다른 예 :
thin
그것을 해결로 전환
webrick
를 사용할 때 에러를 보았다면
#!/usr/bin/env rackup -Ilib:../lib -s thin
require 'sinatra/async'
require 'rack/fiber_pool'
class AsyncTest < Sinatra::Base
register Sinatra::Async
use Rack::FiberPool
enable :show_exceptions
aget '/' do
body "hello async"
end
end
run AsyncTest.new