在gem安装sinatra之后,我启动了一个非常基本的演示代码myapp.rb
require 'sinatra'
get '/' do
'Hello world!'
end
运行" ruby myapp.rb",访问http://localhost:4567/失败
application error
NoMethodError at /
undefined method `clear' for nil:NilClass
file: base.rb location: call! line: 921
BACKTRACE
/var/lib/gems/2.3.0/gems/sinatra-2.0.3/lib/sinatra/base.rb in call!
def call!(env) # :nodoc:
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
template_cache.clear if settings.reload_templates
这里template_cache为nil,我的sinatra版本为2.0.3,gem版本为2.3.0。
我该如何解决?