15 Dec 2009, 11:21pm
ruby:
by

1 comment

Hello Rack

What is Rack?

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.

- Rack API Docs


Create and name your file config.ru If rack isn’t installed get it with this command

gem install rack

In your config.ru file

require 'rubygems'
require 'rack'

class HelloRack
  def call(env)
    [200, {"Content-Type" => "text/html"}, "Hello Rack!"]
  end
end

Rack::Handler::Mongrel.run HelloRack.new, :Port => 8888

Check out http://m.onkey.org/2008/11/17/ruby-on-rack-1

  • http://seanbehan.com Sean

    the smiley face is really “:” “p” together and so they ruby symbol is :port => ” …emoticon fail!