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 3853516
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:28:51+00:00 2026-05-19T17:28:51+00:00

I installed Sinatra and it works but it uses port 4567 by default. I

  • 0

I installed Sinatra and it works but it uses port 4567 by default. I want it to run on port 80.

In an effort to get it to work on port 80, I tried this:

require 'rubygems'
require 'rack/handler/webrick'
require 'sinatra'

Sinatra::Application.default_options.merge!(
  :run => false,
  :env => :production,
  :port => 80
)

get '/' do
  "Hello World"
end

But I get this error:

$ ruby -rubygems index.rb
index.rb:5:in `<main>': undefined method `default_options' for Sinatra::Application:Class (NoMethodError)

Any idea what’s going on?

  • 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-19T17:28:52+00:00Added an answer on May 19, 2026 at 5:28 pm

    Can’t you just use (http://www.sinatrarb.com/configuration.html):

    set :port, 80
    

    Note that in order to bind a socket to port 80, you’ll need to have superuser privileges.


    And, by the way,

    Using Sinatra.default_options to set base configuration items is obsolete

    From: http://www.sinatrarb.com/one-oh-faq

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

Sidebar

Related Questions

Installed rubyinstaller-1.8.7-p358.exe, then tried to install jammit , but the config.gem command isn't being
I installed clojure-mode and slime using the emacs starter kit and I get this
I have correctly (or prbably not) installed passenger on apache 2. Rack works, but
I have the following versions installed: thin (1.2.11, 1.2.7, 1.2.2) But I always want
EDIT: This seems to work on my CentOS machine but not my Ubuntu box.
EDIT - 'carrierwave' doesn't work with Sinatra 1.3. Sinatra 1.2.7 rocks this code! I'm
Installed Attlassian JIRA on windows 7, and it works only on h_t_t_p://localhost:8088, but if
Installed both SonataMediaBundle, SonataNewsBundle and SonataAdminBundle (and much more but these matter). When posting
I installed the packages Android 2.1, Android 2.2 Android 4.0.3, but other than 2.1,
I'm deploying a Sinatra app using passenger. The deployed app is working, but not

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.