2

I'm trying the get Sinatra-syncrony running. This seems to be a simple starting app, but I can't get it to work.

If I uncomment require 'sinatra/synchrony' the standard Sinatra app works fine.

Error:

NoMethodError at /
undefined method `call' for nil:NilClass
file: fiber_pool.rb | location: rescue in block in call | line: 24

App.rb:

require 'sinatra'
require 'sinatra/synchrony'
require 'haml'

get '/' do
  haml :layout
end

views/layout.haml:

Hello World!

Running server with: ruby -rubygems app.rb


Setup:

  • Ruby 1.9.2
  • Sinatra 1.2.7 (Also tried 1.3.1)
  • Sinatra-synchrony 0.3.0

1 Answer 1

4

It seems that you're using Webrick and it's cause of your error. Try to use an EventMachine-aware server such as Thin. For example, install thin gem and prepare following config.ru file:

require './app'
run Sinatra::Application

After that run sinatra with that command: rackup -s thin

1
  • I was using Mongrel, but ye, might be the same. I'll try thin as soon as I can.
    – Frexuz
    Nov 16, 2011 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.