Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 812839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:15:54+00:00 2026-05-15T01:15:54+00:00

I have correctly (or prbably not) installed passenger on apache 2. Rack works, but

  • 0

I have correctly (or prbably not) installed passenger on apache 2. Rack works, but sinatra keeps giving 404’s.

Here is what works:
config.ru:

#app = proc do |env|
  return [200, { "Content-Type" => "text/html" }, "hello <b>world</b>"]  
end
run app

Here is what works too:
Running the app.rb (see below) with ruby app.rb and then looking at localhost:4567/about and /

restarting the app, gives me a correct hello world. w00t.

But then there is the sinatra entering the building:
config.ru

require 'rubygems'
require 'sinatra'

root_dir = File.dirname(__FILE__)

set :environment, ENV['RACK_ENV'].to_sym
set :root,        root_dir
set :app_file,    File.join(root_dir, 'app.rb')
disable :run

run Sinatra::Application

and an app.rb

require 'rubygems'
require 'sinatra'

get '/' do 
 "Hallo wereld!"
end

get '/about' do
 "Hello world, it's #{Time.now} at the server!"
end

This keeps giving 404s.
/var/logs/apache2/error.log lists these correctly as “404” with something that worries me:

83.XXXXXXXXX - - [30/May/2010 16:06:52] "GET /about " 404 18 0.0007
83.XXXXXXXXX - - [30/May/2010 16:06:56] "GET / " 404 18 0.0007

The thing that worried me, is the space after the / and the /about. Would apache or sinatra go looking for /[space], like /%20?

If anyone knows what this problem relates to, maybe a known bug (that I could not find) or a known gotcha?
Maybe I am just being stupid and getting “it all wrong?”

Otherwise any hints on where to get, read or log more developers data on a running rack, sinatra or passenger app would be helpfull too: to see what sinatra is looking for, for example.

Some other information:
Running ubuntu 9.04, apache2-mm-prefork (deb), mod_php5, ruby 1.8.7, passenger 2.2.11, sinatra 1.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:15:55+00:00Added an answer on May 15, 2026 at 1:15 am

    You are not loading the routes in app.rb. To do this, replace require 'sinatra' with require File.join(File.dirname(__FILE__), 'app.rb') in config.ru.

    root_dir = File.dirname(__FILE__)
    app_file = File.join(root_dir, 'app.rb')
    require app_file
    
    set :environment, ENV['RACK_ENV'].to_sym
    set :root,        root_dir
    set :app_file,    app_file
    disable :run
    
    run Sinatra::Application
    

    set :app_file won’t load them for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query which works correctly in MySQL. More background on it here
I have installed correctly the Android SDK, Android NDK, eclipse, and I have the
Possible Duplicate: SmartGWT Dialog title not set correctly I have a problem, is that
I have some CSS that doesn't behave correctly with IE8. It works fine with
Ok this is probably just me not knowing enough about php but here it
Im thinking this is correct, but probably WAY off. I have a string formatted
I have implemented correctly bump's api, and added this code: - (void) configureBump {
In the interpreter for my programming languages I have to correctly handle the parts
i have problem to correctly bind data to WPF Chart. When i'm setting ItemsSource
Hope I'm asking this correctly: I have a project Projects.Client I have my class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.