Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#158

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

Reported by Paul Krefta · May 19th, 2012 @ 06:58 PM

State: new
Milestone: Future
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer

    Try adding a: require "thin" in there.

    May 20th, 2012 @ 02:56 PM

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.