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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:09:13+00:00 2026-05-28T11:09:13+00:00

I have a Sinatra::Base webservice which I want to start from a command line

  • 0

I have a Sinatra::Base webservice which I want to start from a command line Ruby program, so I have this:

# command line program file
require 'mymodule/server'

puts "Running on 0.0.0.0:4567, debugging to STDOUT..."

MyModule::Server.run! bind: '0.0.0.0', port: 4567, environment: :production

This works as expected but it throws out:

$ myscript
Running on 0.0.0.0:4567, debugging to STDOUT...

== Sinatra/1.3.1 has taken the stage on 4567 for production with backup from Thin
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop

127.0.0.1 - - [23/Dec/2011 18:44:55] "POST /images HTTP/1.1" 200 360 0.0133
...

And I want it to be silent, and let me output what I want. For example, if I start it not daemonized I want to just see some message from the command line program and the log output, something like:

$ myscript
Running on 0.0.0.0:4567, debugging to STDOUT...
127.0.0.1 - - [23/Dec/2011 18:44:55] "POST /images HTTP/1.1" 200 360 0.0133
...

Also would like to silently shutdown it, hiding:

== Sinatra has ended his set (crowd applauds)

One last question, is this the best option to start a sinatra app with thin from inside an application code(ruby script in this case)?

  • 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-28T11:09:14+00:00Added an answer on May 28, 2026 at 11:09 am

    You can turn off Sinatra logging with

    set :logging, false
    

    http://www.sinatrarb.com/configuration.html

    As far as whether or not this is the best way to start a sinatra app… You might want to look at the “foreman” gem, and the “Procfile” (which Heroku.com uses) as an example:

    http://ddollar.github.com/foreman/

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

Sidebar

Related Questions

I have developed a web service(using ruby/sinatra/sqs) which runs on Linux Red Hat. I
In the Sinatra ruby framework, I have a route like this: get '/portfolio/:item' do
I have a small Sinatra app which generates html fragments for me from an
I have a simple config.ru file for my Sinatra app. require 'sinatra' require 'app'
I'm looking for a lightweight Ruby web framework and have come across Sinatra and
I have a Sinatra::Base object that I would like to include in all of
I have a Sinatra app which would be used by different clients. I wish
why cannot I use @env['REMOTE_ADDR'] outside a route in Sinatra? I want to have
I'm very new to ruby & Sinatra and I have a basic question: The
I have a Sinatra server that is returning multiple JSON objects from the database

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.