ytti / oxidized-web

Web UI + RESTful API for Oxidized
118 stars 72 forks source link

wrong number of arguments (given 2, expected 1) when using ruby 3.0 #227

Closed einsibjarni closed 3 months ago

einsibjarni commented 2 years ago

OS: FreeBSD 12.3 Version: 0.13.1

FreeBSD ports has replaced ruby27 with ruby30 as default ruby version. After rebuilding all ports and trying to run oxidized we get this error:

#<Thread:0x0000000805d577a0 /usr/local/lib/ruby/gems/3.0/gems/oxidized-web-0.13.1/lib/oxidized/web.rb:28 run> terminated with exception (report_on_exception is true):
/usr/local/lib/ruby/gems/3.0/gems/puma-5.6.4/lib/rack/handler/puma.rb:63:in `run': wrong number of arguments (given 2, expected 1) (ArgumentError)
    from /usr/local/lib/ruby/gems/3.0/gems/oxidized-web-0.13.1/lib/oxidized/web.rb:29:in `block in run'
wrong number of arguments (given 2, expected 1)

I can patch around it with this patch:

@@ -26,7 +26,7 @@

       def run
         @thread = Thread.new do
-          Rack::Handler::Puma.run @app, @opts
+          Rack::Handler::Puma.run @app, **@opts
           exit!
         end
       end

I have no ruby experience so I have no idea if this is the correct way to fix this, but oxidized runs after this change. I'll leave it to smarter people than me to implement

robertcheramy commented 3 months ago

Fixed in 83973c977c0875e6b01a8f9f87a3b09456687299