Sinatraã0.9.2ã«updateããã¨WEBrickã§åä½ããªããªã£ã
Sinatraã0.9.2ã«updateããã¨ã以ä¸ã®ã¨ã©ã¼ã«ãªã£ã¦çµã¿è¾¼ã¿ã®WEBrickã§åããªããªã£ã¦ãã¾ã£ãã
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.2/lib/sinatra/base.rb:930:in `detect_rack_handler': Server handler (thin,mongrel,webrick) not found. (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/sinatra-0.9.2/lib/sinatra/base.rb:862:in `run!' from /usr/lib/ruby/gems/1.8/gems/sinatra-0.9.2/lib/sinatra/main.rb:34 ...
sinatra/base.rbã®921è¡ç®ãdetect_rack_handlerãã§ã対å¿ãããµã¼ãã¼ãRack::Handlerã«ç»é²ããã¦ããªããã¨ã©ã¼ã«ãªã£ã¦ããã
åå
Rack::Handlerã«ã¯ãå©ç¨å¯è½ãªãµã¼ãã¼ã¨ãã¦"mongrel"ã"webrick"ãç»é²ããã¦ãããsinatraã¯ãµã¼ãã¼ã¨ãã¦ãthin,mongrel,webrickããæ¢ãã«ããããéä¸(sinatra/base.rbã®925è¡ç®)ã§ãªãããcapitalizeããã¦æ¢ç´¢ãã¦ããããã®ããã対å¿ãããµã¼ãã¼ãããããããã¨ã©ã¼ã«ãªã£ã¦ãã¾ã£ã¦ããããã¼ãæ®éã«ãã°ã£ã½ããªã¼ã
対ç
以ä¸ã®ãã¾ããªããæåã®æ¹ã«æ¸ãã¦ããã°ãåé¡ãã¨ããããåé¿ã§ãã¾ãã
Rack::Handler.register 'Webrick', 'Rack::Handler::WEBrick'
Rack::Handlerã«ãcapitalizeãå¾ã®ãµã¼ãã¼åã§ãç»é²ãã¦ããã¨ããä»çµã¿ãå ¨ä½ã¯âã®ãããªæãã«ãªãã¾ãã
require 'rubygems' require 'sinatra' Rack::Handler.register 'Webrick', 'Rack::Handler::WEBrick' get( "/" ) { 'Hello world!' }