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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:07:47+00:00 2026-06-01T03:07:47+00:00

I’m having problems settig up my application using Thin and Sinatra. I have created

  • 0

I’m having problems settig up my application using Thin and Sinatra. I have created a development-config.ru file that contains the following settings:

# This is a rack configuration file to fire up the Sinatra application.
# This allows better control and configuration as we are using the modular
# approach here for controlling our application.
#
# Extend the Ruby load path with the root of the API and the lib folder
# so that we can automatically include all our own custom classes. This makes
# the requiring of files a bit cleaner and easier to maintain.
# This is basically what rails does as well.
# We also store the root of the API in the ENV settings to ensure we have
# always access to the root of the API when building paths.
ENV['API_ROOT'] = File.dirname(__FILE__)
$:.unshift ENV['API_ROOT']
$:.unshift File.expand_path(File.join(ENV['API_ROOT'], 'lib'))
$:.unshift File.expand_path(File.join(ENV['API_ROOT'], 'db'))

# Now we can require all the gems used for the entire API by simpling requiring
# them here. We can also include the classes that we have defined inside the lib
# folder.
require 'rubygems'
require 'bundler'

# Run Bundler to setup our gems properly. This will install  all the missing gems on
# the system and ensure that the deployment environment is ready to run.
Bundler.require

# To make the loading easier for the application, we will now automatically load all
# models that have been defined inside the lib folder. This ensures that we do not need
# to load them anymore anywhere else in our application, as the models will be known to
# ruby everywhere.
Dir.glob(File.join(ENV['API_ROOT'], 'lib', '**', '*.rb')).each{|file| require file}

# Now we will configure the Sinatra application so that we can fire up the entire API.
# This requires some detailed settings like whether logging is allowed, the port to be
# used and some folder locations.
require 'sinatra'
require 'app'
set :logging, true
set :dump_errors, true
set :port, 3001
set :views, "#{ENV['API_ROOT']}/views"
set :public_folder, "#{ENV['API_ROOT']}/public"
set :environment, :test

# Start up the Sinatra application with all the settings that we have defined.
run App.new

This is based upon the information I found on the Sinatra website. However, the problem is that I cannot get the application running on port 3001.
If I use thin start -R development-config.ru it runs on port 3000. If I use rackup config-development.ru it runs on port 9696. However I never see Sinatra kick in or run over port 3000.

My application looks like this:

# Author : Arne De Herdt
# Email : 
# This is the actuall application that will be running under Sinatra
# to serve the requests for the billing middleware API.
# We use the modular approach here to allow control when deploying
# the application using Capistrano.
require 'sinatra/base'
require 'logger'
require 'savon'
require 'billcrux'

class App < Sinatra::Base
  # This action responds to POST requests on the URI '/billcrux/register'
  # and is responsible for handeling registration requests with the
  # BillCrux payment system.
  # The
  post "/billcrux/register" do
    # do stuff
  end
end

Can someone tell me what I am doing wrong?

  • 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-06-01T03:07:48+00:00Added an answer on June 1, 2026 at 3:07 am

    Found the solution.

    Rack::Handler::Thin.run App.new, :Port => 3001
    

    instead of

    run App.new
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a reasonable size flat file database of text documents mostly saved in
I have thousands of HTML files to process using Groovy/Java and I need to

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.