2012-04-27 3 views

答えて

3

代わりに、組み込みのWEBrickサーバーを使用できます。

# app.rb 
class App 
    def call(env) 
    return [200, {"Content-Type" => "text/html"}, "Hello, World!"] 
    end 
end 

# config.ru 
require 'app' 
run App.new 

あなたが代わりにそれを統合し、ちょうど直接ruby app.rbを実行できます:

#app.rb 
class App 
    def call(env) 
    return [200, {"Content-Type" => "text/html"}, "Hello, World!"] 
    end 
end 

Rack::Handler::WEBrick.run(App.new, :Port => 9292) 
+1

おかげで、しかし、私はより多くのラック 'のようなものを使用して開始しました::サーバーですから、通常はこのようなものを持っている可能性がある場所純粋なWEBBrickサーバーではなく、.start(...) '(薄いサーバーも使用できます)。ヒントをありがとう! – beakr

関連する問題