# Tutorial: Run a Sinatra application

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

[Sinatra](https://github.com/sinatra/sinatra) is a library for creating web applications. RubyMine allows you to run a Sinatra application directly as a [Ruby script](running-ruby-scripts.html) or by using the dedicated [Rack](rack.html) run/debug configuration if you are using the rackup tool.

In this tutorial, we'll show you how to run the [sample Sinatra application](https://github.com/rubyminedoc/palindrome_app) in RubyMine directly as a Ruby script, how to run the application by using the rackup tool, and how to configure additional running options using [run/debug configurations](run-debug-configuration.html).

> **Note:**
> Clone the sample application by the following link: [palindrome_app](https://github.com/rubyminedoc/palindrome_app)

## Prerequisites

Before running the Sinatra application, make sure that the following prerequisites are met:

* The 'sinatra' and 'rack' gems [are installed](using-the-bundler.html) to the project interpreter.

* The required web server gem (for example, 'thin' or 'puma') is installed to the project interpreter.

## Run an application as a Ruby script

Procedure: Run an application

To run a Sinatra application as a Ruby script, follow the steps below:

1. Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (TextMate), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to invoke the [Run Anything](running-anything.html) popup.

2. Type the following command in the popup and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

```CONSOLE
ruby app.rb
```

If necessary, you can specify the required command-line options and script arguments. For example, to run the application with the Puma server, use the following command:

```CONSOLE
ruby app.rb -s Puma
```

In this case, the `-s Puma` command part will be passed as Script arguments to the created [Ruby configuration](#configure_sinatra_ruby).

3. Wait until RubyMine starts the application. The Run tool window shows the application's output.

Procedure: Configure running options

After you run an application as a Ruby script, RubyMine automatically creates the [Ruby](running-ruby-scripts.html#ruby_run_config) run/debug configuration. You can customize it to pass additional options.

1. Select `Run | Edit Configurations` from the main menu.

2. In the opened Run/Debug Configurations dialog, select the created ruby app.rb configuration in the Ruby group, and pass the required [running options](https://github.com/sinatra/sinatra#command-line) in the Script arguments field. For example, to use the Puma server for this configuration, specify the following value:

```CONSOLE
-s Puma
```

3. Click OK to save the configuration.

## Run the application with 'config.ru'

To run the Sinatra application that uses `config.ru` file, follow the steps below:

Procedure:

1. Open the Project view `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)).

2. Right-click the `config.ru` and select Run 'config.ru'.

3. Wait until RubyMine starts the application. The Run tool window shows the application's output.

See [Run Rack applications](rack.html) to learn more about running Rack applications.

