I'm new to Ruby Sinatra, I tried to build a simple web application with Sinatra with the following code:
require 'rubygems'
require 'sinatra'
get '/firstapp' do
"Welcome to my first Sinatra App !"
end
when I tried to run it with the command "ruby file.rb" on windows command prompt, an error occured:
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1755:in `detect_rack_handler': Server handler (thin,puma,reel,HTTP,webrick) not found. (RuntimeError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1493:in `run!'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/sinatra-2.1.0/lib/sinatra/main.rb:45:in `block in <module:Sinatra>'
When I installed sinatra, I forgot to set the path to C:(ruby install directory)\bin. I have set the path after installing sinatra
I have no idea what happened. Can someone help me with this?
install these last one gem using
$ gem install thin
$ gem install puma
$ gem install reel
$ gem install http
$ gem install webrick
work for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With