Sinatra和MacRuby没有工作

时间:2010-12-14 05:39:03

标签: ruby sinatra macruby

似乎无法让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:'

1 个答案:

答案 0 :(得分:0)

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