From: Alex Chaffee Date: 2012-01-25T05:13:58+09:00 Subject: Re: Web Application from Scratch - like PHP > I intend to learn Ruby thoroughly before jumping to any Ruby web > framework. How do I create simple web applications using plain Ruby (and > a server like WEBrick of course)? If Rack is too hardcore for you, try Sinatra. Here's the code for Sinatra's Hello World app: require "sinatra" get "/hello" do "

Hello!

" end Stick that in "hello.rb" and run "ruby hello.rb" and visit http://localhost:4567/hello to see it in action. And it's easy to deploy a Sinatra app to Heroku too. It has support for a fair number of web features like HTML templates and status codes and such and plenty of docs at http://www.sinatrarb.com/ Sinatra doesn't do databases on its own, but there's nothing stopping you from using ActiveRecord or DataMapper or Sequel or even DBI [1] to access a relational DB inside your requests. [1] http://ruby-dbi.rubyforge.org/ > I intend to learn Ruby thoroughly before jumping to any Ruby web > framework. I applaud your decision! Too many people learn Ruby as an afterthought to Rails, and pick up lots of misconceptions and bad habits as a result. If you need some pointers to online Ruby tutorials, let me recommend: http://testfirst.org/ and http://testfirst.org/learn_ruby http://rubykoans.com/ http://rubymonk.com/ http://pine.fm/LearnToProgram/ - A -- Alex Chaffee - alex@stinky.com http://alexchaffee.com http://twitter.com/alexch