Hello,
I've a problem with running simple app using Thin with
EventMachine. I've installed all gems I needed & after trying
to run following code.
require "rack"
require "rack/sockjs"
require "eventmachine"
# My app.
class SimpleApp
def call(env)
body = "This is the app, not SockJS."
headers = {
"Content-Type" => "text/plain; charset=UTF-8",
"Content-Length" => body.bytesize.to_s
}
[200, headers, [body]]
end
end
app = Rack::Builder.new do
# Run one SockJS app on /echo.
use SockJS, "/echo" do |connection|
connection.subscribe do |session, message|
session.send(message)
end
end
# ... and the other one on /close.
use SockJS, "/close" do |connection|
connection.session_open do |session|
session.close(3000, "Go away!")
end
end
run SimpleApp.new
end
EM.run do
thin = Rack::Handler.get("thin")
thin.run(app.to_app, :port => 8081)
end
I'm getting following error
/Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/thin-1.3.1/lib/thin/response.rb:43:in `<class:Response>': undefined method `ruby_18?' for Thin:Module (NoMethodError)
What am I doing wrong ? :)