有谁知道是什么导致了这个错误?我正在尝试制作一个基本的机架应用程序。
App.rb =>
class Cherry
class << self
def app &block
Cherry::Application.new &block
end
end
class Application
def initialize &block
instance_eval &block
end
def print_start_message
puts "Starting server"
end
def call env
[200, {"Content-type" => "text/plain"}, "Hello World"]
end
end
end
Config.ru =>
require 'app'
run Cherry.app do
print_start_message
end
编辑:显然我忘了包括错误呜呜声:
/local/www/cherry/lib/app.rb:12:in 'instance_eval': block not supplied (ArgumentError)