【发布时间】:2010-06-07 14:01:29
【问题描述】:
我正在尝试启动我的第一个 Sinatra 应用程序,但从乘客那里得到一个错误页面:
undefined method `application' for Sinatra:Module
这是我的 Rackup 文件:
require 'rubygems'
require 'sinatra'
set :env, :production
disable :run
require 'app'
run Sinatra.application
还有应用程序本身:
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'haml'
get '/' do
haml :index
end
get '/hello/:name' do |name|
@name = name
haml :hello
end
get '/goodbye/:name' do |name|
haml :goodbye, :locals => {:name => name}
end
__END__
@@layout
%html
%head
%title hello.dev
%body
=yield
@@index
#header
%h1 hello.dev
#content
%p
This is a test...
@@hello
%h1= "Hello #{@name}!"
@@goodbye
%h1= "Goodbye #{name}!"
我哪里错了?
【问题讨论】:
标签: ruby apache sinatra passenger