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

Load tempfile explicitly #73

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

pocke
Copy link
Contributor

@pocke pocke commented Aug 1, 2024

Problem

This gem raises the following error when --metadata option is not specified.

bundler: failed to load command: diver_down_web (/app/vendor/bundle/ruby/3.3.0/bin/diver_down_web)
/app/vendor/bundle/ruby/3.3.0/gems/diver_down-0.0.1.alpha16/exe/diver_down_web:41:in `<top (required)>': uninitialized constant Tempfile (NameError)

    metadata: DiverDown::Web::Metadata.new(options[:metadata] || Tempfile.new(['metadata', '.yaml']).path)
                                                                 ^^^^^^^^
        from /app/vendor/bundle/ruby/3.3.0/bin/diver_down_web:25:in `load'
        from /app/vendor/bundle/ruby/3.3.0/bin/diver_down_web:25:in `<top (required)>'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
        from /app/vendor/bundle/ruby/3.3.0/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
        from /usr/local/bin/bundle:25:in `load'
        from /usr/local/bin/bundle:25:in `<main>'

Solution

Load tempfile explicitly.


Probably this problem has been introduced by this commit 3397d9d.
Previously WEBrick loaded tempfile library, but requireing webrick has been removed. So it cannot find Tempfile constant.

@alpaca-tc alpaca-tc merged commit e4424c2 into alpaca-tc:main Aug 13, 2024
6 checks passed
@alpaca-tc
Copy link
Owner

Sorry for the late action, thank you for the PR!

@pocke pocke deleted the Load__tempfile__explicitly branch August 14, 2024 01:29
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