lsegal / yard

YARD is a Ruby Documentation tool. The Y stands for "Yay!"
http://yardoc.org
MIT License
1.94k stars 397 forks source link

Error starting server: nil port #1493

Closed ximes closed 1 year ago

ximes commented 1 year ago

I'm failing to start the Yard server recently. There's apparently an issue with the port parameter which is not passed correctly to Puma.

Steps to reproduce

  1. Run the following command: yard server or even yard server -p 8808

Actual Output

It errors with the following:

>> YARD 0.9.32 documentation server at http://localhost:8808
~/gems/puma-6.2.1/lib/puma/dsl.rb:314:in `Integer': can't convert nil into Integer (TypeError)

      bind URI::Generic.build(scheme: 'tcp', host: host, port: Integer(port)).to_s
                                                                       ^^^^
        from ~/gems/puma-6.2.1/lib/puma/dsl.rb:314:in `port'
        from config/puma.rb:4:in `_load_from'

Expected Output

The server starts correctly instead. If I provide a ENV var for it, as in the following command:

PORT=8808 yard server

server opens just fine.

Environment details:

I have read the Contributing Guide.

MSP-Greg commented 1 year ago

I'm failing to start the Yard server recently.

It's working fine on my system, using rackup/rack. Using Ruby 3.2.2, Yard 0.9.33, Puma 6.2.1, Rack 3.0.7, RackUp 2.1.0.

Not sure where the problem is. You stated 'recently', do you recall when it did work? Can you post config/puma.rb?

ximes commented 1 year ago

Argh you're right. I had a local port override in my config/puma.rb (port ENV["PORT"]) which I missed, All working fine here :) My bad, closing it.