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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:03:44+00:00 2026-05-23T17:03:44+00:00

Where does the concept of ‘development mode’ come from when using ruby + webrick

  • 0

Where does the concept of ‘development mode’ come from when using ruby + webrick + sinatra?

require 'sinatra'
require 'sinatra/reloader'

get '/test' do
  development?.to_s
end

When I run the above app by ‘ruby test.rb -p 3000’ http://localhost:3000/test returns “true” … but why does it return true? Is development mode a ruby, webrick, rack or sinatra concept? Also, is this functionality documented anywhere in particular in a non-rails specific manner? I’m finding many people reference the concept of development mode, but I’ve been surprised by how hard it has been to find relevant information … maybe I’m just not google-ing the right keywords …

  • 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-23T17:03:45+00:00Added an answer on May 23, 2026 at 5:03 pm

    Sinatra’s source code (base.rb) shows these 3 definitions:

    def development?; environment == :development end
    def production?;  environment == :production  end
    def test?;        environment == :test        end
    

    So those true/false methods are based on the set environment. Sinatra defaults to run in development mode unless you tell it otherwise (when you start a Sinatra app, you’ll see something like

    == Sinatra/1.2.6 has taken the stage on 4567 for **development** with backup from WEBrick".

    To tell it to run in production, you would do this:

    ruby test.rb -p 3000 -e production
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does the Dispatcher concept in .NET 3.5 and WPF differ from the background
I am at a company that does not understand the concept of using frameworks
As python does not have concept of constants, would it be possible to raise
Does Java and/or Spring have the concept of properties? I have bunch of domain
This concept seems to trouble me. Why does an NSError object need its pointer
Does Google force employees who have offers from Facebook to leave immediately?
Does anyone know how to get IntelliSense to work reliably when working in C/C++
Java does not have concept of operator overloading. Still + operator behaves as addition
Both free(NULL) and ::operator delete(NULL) are allowed. Does the allocator concept (e.g. std::allocator also
Abstraction is a concept that seems difficult to explain, without reverting to using programming

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.