Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require rack/version for Rack::RELEASE constant #159

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

aaronjensen
Copy link
Contributor

Addresses uninitialized constant Rack::RELEASE (NameError) in cases where propshaft is required before rack.

@brenogazzola
Copy link
Collaborator

Thanks for this one @aaronjensen. Before I merge, how do I reproduce this? Just want to check if there is anything else we might need to fix in this situation.

@aaronjensen
Copy link
Contributor Author

❯ bundle exec irb
irb(main):001:0> require "propshaft"
/Users/user/Source/open/propshaft/lib/propshaft/server.rb:43:in `<class:Server>': uninitialized constant Rack::RELEASE (NameError)

    if Gem::Version.new(Rack::RELEASE) < Gem::Version.new("3")
                            ^^^^^^^^^
        from /Users/user/Source/open/propshaft/lib/propshaft/server.rb:3:in `<top (required)>'
        from /Users/user/Source/open/propshaft/lib/propshaft/assembly.rb:4:in `require'
        from /Users/user/Source/open/propshaft/lib/propshaft/assembly.rb:4:in `<top (required)>'
        from /Users/user/Source/open/propshaft/lib/propshaft.rb:9:in `require'
        from /Users/user/Source/open/propshaft/lib/propshaft.rb:9:in `<top (required)>'
        from (irb):1:in `require'
        from (irb):1:in `<main>'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/irb-1.3.7/exe/irb:11:in `<top (required)>'
        from /Users/user/.asdf/installs/ruby/3.2.2/bin/irb:25:in `load'
        from /Users/user/.asdf/installs/ruby/3.2.2/bin/irb:25:in `<top (required)>'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:58:in `load'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:58:in `kernel_load'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli/exec.rb:23:in `run'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/cli.rb:491:in `exec'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /Users/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'

@brenogazzola brenogazzola merged commit 2d884c2 into rails:main Oct 27, 2023
4 checks passed
@aaronjensen aaronjensen deleted the rack-version branch October 27, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants