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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:38:44+00:00 2026-05-14T04:38:44+00:00

I have a Sinatra application I’ve created and I’d like to package it as

  • 0

I have a Sinatra application I’ve created and I’d like to package it as a gem-based binary.

I have my gemspec and gem set up to generate a suitable executable that points to the my_sinatra_app.rb (which is executable) but the sinatra server never runs. Any ideas why and how to make it work?

my_sinatra_app executable:

#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
#
# This file was generated by RubyGems.
require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end

gem 'my_sinatra_app', version
load Gem.bin_path('my_sinatra_app', 'my_sinatra_app', version)
  • 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-14T04:38:44+00:00Added an answer on May 14, 2026 at 4:38 am

    Found out 😀

    You need to wrap your Sinatra app in a class like so:

    class MySinatraApp < Sinatra::Application
      # Stuff
    end
    

    Then in the file that runs the application you can just do MySinatraApp.run! Simple 🙂

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

Sidebar

Related Questions

I'm having problems settig up my application using Thin and Sinatra. I have created
I'm developing a Sinatra-based application and have seen some apps using an environment.rb file
I have a Sinatra based REST service app and I would like to call
I have a variable in my Sinatra application: get '/' do @agenda_date = Date.today
I have a Sinatra app that, boiled down, looks basically like this: class MyApp
I have the following Gemfile: source http://rubygems.org gem 'sinatra', '1.3.2' gem 'json', '1.6.4' And
I run a sinatra application with mongomapper. I have models called Movie(Document) and Cover(EmbeddedDocument).
We are using Datamapper in a Sinatra application and would like to use case
I have a Sinatra/Mongoid application and I noticed that my mongoid model/object does not
I use only one file for sinatra application ( sinatra.rb ) where I have

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.