async-rack icon indicating copy to clipboard operation
async-rack copied to clipboard

Server handler (thin) not found.

Open ghazel opened this issue 14 years ago • 2 comments

When I start this simple server, I get an error: Server handler (thin) not found. (RuntimeError)

require 'async-rack'
require 'sinatra'

set :server, 'thin'

get '/' do
  "Hello, world!"
end

If I comment out the require 'async-rack' line, it starts Thin fine. If I comment out the set :server, 'thin' and use async-rack, it starts WEBrick.

ghazel avatar Jun 23 '11 03:06 ghazel

I don't think sinatra can work out of the box with async-rack. Try https://github.com/ghazel/async_sinatra

aq1018 avatar Jun 24 '11 07:06 aq1018

async_sinatra has the same issue.

require 'async-rack'
require 'sinatra/async'

class TestServer < Sinatra::Base
  register Sinatra::Async
  set :server, 'thin'

  aget '/' do
    body("Hello, world!")
  end
end

TestServer.run!

ghazel avatar Jun 24 '11 11:06 ghazel