Rubyのsinatraで開発をしております。
RackのURLMap.newをする際に、gemファイルに、rackの読み込み等をしているにも関わず、下記添付のエラーが発生致します。原因が不明なため、ご教授頂ければ幸いです。
■gemファイル内容
source 'https://rubygems.org'
ruby '2.6.6'
gem "rack"
gem 'sinatra'
gem 'activerecord'
gem 'sinatra-activerecord'
gem 'rack_csrf'
gem 'mysql2'
■コードファイル内容
require 'sinatra'
require 'sinatra/base'
require './controllers/home.rb'
run Rack::URLMap.new({'/' => Home.new})
エラー:
- Gracefully stopping, waiting for requests to finish
== Sinatra has ended his set (crowd applauds)
== Sinatra (v2.1.0) has taken the stage on 4567 for development with backup from Puma
Puma starting in single mode...
- Puma version: 5.2.2 (ruby 2.6.6-p146) ("Fettisdagsbulle")
- Min threads: 0
- Max threads: 5
- Environment: development
-
PID: 1
- Listening on http://0.0.0.0:4567
Use Ctrl-C to stop
172.20.0.1 - - [02/May/2021:08:43:25 +0000] "GET / HTTP/1.1" 404 458 0.0099
- Gracefully stopping, waiting for requests to finish
== Sinatra has ended his set (crowd applauds)
config.ru:5:in <main>': undefined method
run' for main:Object (NoMethodError)
回答1件
あなたの回答
tips
プレビュー