Where am I going wrong? "undefined method 'application' for Sinatra:Module" Sinatra/Passenger/Apache
- by safetycopy
Hi,
I'm trying to get my first Sinatra app off the ground, but am getting an error page from Passenger:
undefined method `application' for Sinatra:Module
Here's my Rackup file:
require 'rubygems'
require 'sinatra'
set :env, :production
disable :run
require 'app'
run Sinatra.application
And the app itself:
#!/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}!"
Where am I going wrong?