Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Rack and Passenger?

I'm trying to deploy a Sinatra app to Dreamhost and it says the following:

Since DH supports Passenger, which in turn supports Rack-based ruby applications, DH does indeed support Sinatra.

I'm having difficulty parsing that statement - what's the difference between Rack and Passenger (and why is Sinatra "Rack-based")?

like image 419
Yen Avatar asked May 02 '09 05:05

Yen


People also ask

What is rack in Sinatra?

Rack is a bare-bones middleware and therefore a bit more lightweight but doesn't help you that much when building complex applications. Sinatra is a Domain Specific Language (DSL) for quickly creating web-applications in Ruby.

What is rack in Ruby?

Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.


1 Answers

Rack is a standardized API for web servers to talk to middleware and web frameworks in Ruby. Phusion Passenger is an Apache module that implements the Rack API. Sinatra is a web framework that is built on top of the Rack API, so because Dreamhost supports Phusion Passenger, that means that it supports Rack, and thus Sinatra.

like image 61
Brian Campbell Avatar answered Oct 16 '22 03:10

Brian Campbell