You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ puma ./foo.rb
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 34772
! Unable to load application: NoMethodError: undefined method `run' for main:Object/Users/dentarg/Dropbox/mort/code-snippets/rack-3/foo.rb:1:in `<top (required)>': undefined method `run' for main:Object (NoMethodError)run [200, {} ['OK']]^^^ from <internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.9/lib/rack/builder.rb:66:in `parse_file' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:368:in `load_rackup' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:290:in `app'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/runner.rb:162:in `load_and_bind' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/single.rb:44:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/launcher.rb:194:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/cli.rb:75:in `run'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/bin/puma:10:in `<top (required)>' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `load' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `<main>'
$ echo'rackup "./foo.rb"'| puma --config /dev/stdin
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 35386
! Unable to load application: NoMethodError: undefined method `run' for main:Object/Users/dentarg/Dropbox/mort/code-snippets/rack-3/foo.rb:1:in `<top (required)>': undefined method `run' for main:Object (NoMethodError)run [200, {} ['OK']]^^^ from <internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.9/lib/rack/builder.rb:66:in `parse_file' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:368:in `load_rackup' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:290:in `app'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/runner.rb:162:in `load_and_bind' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/single.rb:44:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/launcher.rb:194:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/cli.rb:75:in `run'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/bin/puma:10:in `<top (required)>' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `load' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `<main>'
without ./ your file is not found
$ echo'rackup "foo.rb"'| puma --config /dev/stdin
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 35352
! Unable to load application: LoadError: cannot load such file -- foo.rb
<internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- foo.rb (LoadError) from <internal:/Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/rack-3.0.9/lib/rack/builder.rb:66:in `parse_file' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:368:in `load_rackup'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:290:in `app' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/runner.rb:162:in `load_and_bind' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/single.rb:44:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/launcher.rb:194:in `run'
from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/cli.rb:75:in `run' from /Users/dentarg/.arm64_rubies/3.2.2/lib/ruby/gems/3.2.0/gems/puma-6.4.2/bin/puma:10:in `<top (required)>' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `load' from /Users/dentarg/.arm64_rubies/3.2.2/bin/puma:25:in `<main>'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Not ending your rackup file with
.ru
leads to strange errors due to this codepuma/lib/puma/rack/builder.rb
Lines 155 to 169 in c2aa737
Examples:
without
./
your file is not foundBeta Was this translation helpful? Give feedback.
All reactions