#158 new
Paul Krefta

Problem with thin 1.3.1 on Ruby 1.9.3p125 - no ruby_18? method

Reported by Paul Krefta | May 19th, 2012 @ 06:58 PM | in Future

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 ? :)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages