I installed Sinatra using RubyGems, created a simple file called hello.rb
file contains:
require 'rubygems'
require 'sinatra'
get '/' do
puts "Hello World"
end
I navigated on the terminal to desktop on mac to where i saved the hello.rb and did run the file by: ruby hello.rb it gives me message it is running with WEBrick on this port 4567
I went to localhost:4567 then i get this message “Sinatra doesn’t know this ditty.”
Do i have to save the hello.rb file to the WEBrick server folder to make it work? if so, where is that folder located on the mac?
You have to return something, as in:
Then it will work.
putsprints to the command line but returns nil, so nothing was being returned to sinatra.