
Rack
What the heck is Rack and why is it getting so much press lately? Well, from it’s tag-line: “Rack provides an minimal interface between webservers supporting Ruby and Ruby frameworks.”
But what does that mean? Prior to Rack if you wanted to interface with Mongrel or Thin you had to write your own custom wrapper for talking to that web server. Rack standardized the interface for doing that and even added some icing on the cake.
Resources
- Rack Homepage – This is the official Rack home page. There’s a mirror on GitHub as well.
- Rack on GitHub – This is the official Rack source repository.
- Rack-Contrib – This is the repository for rack middleware and different rack utilities. It’s a great starting point for examples.
- Rack-development – The official Rack Google Group. It’s a great place to ask questions or get help with Rack related troubles.
- Rack::Test and its RDoc. Much like Rack is a standard interface for talking to web servers, Rack::Test is a standard interface for testing Rack apps.
Tutorials and Links
- Introducing Rack by Christian Neukirchen. Christian is the author rack and this is the introductory blog post about it.
- Introduction to Rack Middleware – This tutorial goes through what Rack middleware is and gives an example of writing an ascii shrimp middleware in your application.
- Creating a Rack middleware for minifying your javascript files – This post by Luciano Panaro is less of a tutorial than a full fledged middleware with explanation but it is a solid example to learn from.
- Adding cache headers by Vidar Hokstad is another example of creating a middleware for a specific purpose.
- Rack middleware asciicast the same version of the RailsCast below but in text form.
- Ruby Rack Middleware Tutorial – This tutorial goes over the call chain and gives a real world example.
- Flash uploaders, Rails, cookie based sessions and CSRF: Rack Middleware to the rescue! – This is one of the better tutorials out there because it starts with a real world problem and demonstrates how to solve it.
- It’s Only Rack on Rails But I Like It – Noel Rappin goes through and gives a brief introduction to Rack, why it’s good for Rails, and how to use it from a Rails app.
- How to setup and use Rack::Cache with Rails 2.3 – The title is pretty self explanatory.
- Rack::Test tutorial – Simply test any Rack-compatible app.
- Rails Metal introduction is an awesome introduction to Rails Metal by Jesse Newland.
- Plugging Rack into Rails – Another rack/rails tutorial.
- How to Rackup – This is from the official Rack wiki and explains what Rackup files are and hwo to use them.
Screencasts, Videos, and Presentations
- Rack presentations on the Rack GitHub wiki.
- Jon Crosby’s MountainWest Ruby Conf presentaiton – In a world of middleware, who needs monolithic applications?
- Rack middleware RailsCast – Ryan Bates usual high quality screencasts on how to create a Rack Middleware
- Rails Metal RailsCast – An introduction to creating Rails Metal apps by Ryan Bates
- Rack basics – Remi goes in to the very basics of Rack.
- Rack part 2 – Going over rackup files, creating an executable rack application, using middleware, reloading
- Rack Middleware – What it is, how to write your own, using it in Sinatra and Rails
- Another Rack middleware screencast
Middleware
- List of Rack Middleware on the Rack wiki.
- Rack-Cache – HTTP reverse proxy cache (Google Group). If you want to explore using HTTP caching to its fullest check out this link. It has a few links that explain HTTP caching as well.
- CSS Variables and a tutorial for using it.
- Hancock-client is a sinatra app and rack middleware piece for the hancock SSO server.
Documentation
- Rails on Rack gives you Rails and Rack specific information. This was suggested by Hubert Lepicki in the comments.
- Rack Documentation (RDOC)
- Rack Specification
Delicious
Digg This Post
Facebook
Reddit This Post
No related posts.





Fantastic collection of links Jason! You've done all the leg work for me and wrapped it all up in a pretty bow.
This belongs to RailsEnvy.com. Great work!
Hi, great that you linked to my Shrimp tutorial ;).
The only link I would add is http://guides.rubyonrails.org/rails_on_rack.html which I found very useful for getting started with Rack, and gives you some info of Rails-specific Builder tool you can use.
Great suggestion, I added the link. Thanks!
Well, you got me on this one. I came in on a rack rail keyword search. I can say I learned something new reading this. I am pretty good at advising people on the correct server rack to use with there hardware. If I can be of help to anyone, let me know.
Well, you got me on this one. I came in on a rack rail keyword search. I can say I learned something new reading this. I am pretty good at advising people on the correct server rack to use with there hardware. If I can be of help to anyone, let me know.
Well, you got me on this one. I came in on a rack rail keyword search. I can say I learned something new reading this. I am pretty good at advising people on the correct server rack to use with there hardware. If I can be of help to anyone, let me know.
There's a Rack coding contest starting now if you want to enter. It's at http://www.coderack.org
Some great prizes and it promises to be a lot of fun.
I subscribed to your blog when is the next post
Have a nice day
jenny glab
______________________________________________
Thanks for the info.
Been trying to find an example where someone builds a simple Rack application by casacading separate Rails applications and keeps the rails sessions synchronized. Can't seem to find any examples of this.
Any ideas how to do this in Rack::Builder or where an example of this is?
Thanks.
Thanks for the info.
Been trying to find an example where someone builds a simple Rack application by casacading separate Rails applications and keeps the rails sessions synchronized. Can't seem to find any examples of this.
Any ideas how to do this in Rack::Builder or where an example of this is?
Thanks.