0
votes

I am trying to create an empty Sinatra application with a config.ru file. Right now the only way I know how is to initialise it with cucumber but doing that creates extra files which I don't need including step definitions etc. When I run 'gem install Sinatra' in my working directory it says:

Successfully installed sinatra-1.4.5 Parsing documentation for sinatra-1.4.5 Done installing documentation for sinatra after 0 seconds 1 gem installed

Yet there is no config.ru file.

How do I initialise a Sinatra app so I have just the config.ru?

1
Paul's answer is good, but if you really want a rackup file, look in the docs for how to run a modular app, and use what you've got from Paul's answer to build on. - iain

1 Answers

2
votes

From the sinatra documentation

first create a file called app.rb in your working directory containing the following code:

require 'sinatra'

get '/' do
  'Hello world!'
end

now create a file called config.ru with the following content:

require './app'
run Sinatra::Application

now run

rackup -p4567

to run the application