Where am I going wrong? "undefined method 'application' for Sinatra:Module" Sinatra/Passenger/Apache

Posted by safetycopy on Stack Overflow See other posts from Stack Overflow or by safetycopy
Published on 2010-06-07T14:01:29Z Indexed on 2010/06/07 14:12 UTC
Read the original article Hit count: 327

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about apache