在linux上,gem install sinatra slim thin
接著 vi simple.rb 內容如圖:


再 ruby simple.rb
$ ruby simple.rb
== Sinatra (v1.4.6) has taken the stage on 4567 for development with backup from Thin
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on localhost:4567, CTRL+C to stop
127.0.0.1 - - [27/Oct/2015:21:01:01 +0800] "GET / HTTP/1.1" 200 176 0.0340
127.0.0.1 - - [27/Oct/2015:21:01:30 +0800] "POST / HTTP/1.1" 200 87 0.0130
127.0.0.1 - - [27/Oct/2015:21:01:35 +0800] "GET / HTTP/1.1" 200 176 0.0156
瀏覽器訪問
http://localhost:4567就最簡單的型式完工。