2

似乎无法让 Sinatra 和 MacRuby/control_tower 一起工作。

我的 sinatra 服务器非常简单(main.rb):

require 'rubygems'
require 'sinatra'

get "/" do
  "Hello World!"
end

使用一个非常简单的 RackUp 文件 (config.ru):

require 'main'
run Sinatra::Application

运行:control_tower看起来它正在工作,但随后爆炸:

You are cleared for take-off!
Listening on 0.0.0.0:3000
NoMethodError - undefined method `GET /' for #<Sinatra::Application:0x20026c9e0>:
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1033:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:604:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:654:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:631:in `process_route:'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:603:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:600:in `route!'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:739:in `dispatch!'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `invoke'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:523:in `call!:'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in `call:'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `block'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `call:'
 /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/control_tower-1.0/lib/control_tower/rack_socket.rb:46:in `block'
NoMethodError: undefined method `GET /' for #<Sinatra::Application:0x20026c9e0>
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:739:in `dispatch!'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:530:in `block'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `block'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:706:in `invoke'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:523:in `call!:'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/rack-1.2.1/lib/rack/showexceptions.rb:24:in `call:'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `block'
    /Users/jpoz/.rvm/gems/macruby-0.7.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1142:in `call:'
4

1 回答 1

0

请向 MacRuby 项目而不是本网站报告错误。http://www.macruby.org/contact-us.html

于 2010-12-14T06:49:19.660 回答