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

Jekyll_admin_monkey_patch': uninitialized constant Rack::Handler (NameError) #721

Open
Mr0Wido opened this issue Feb 15, 2025 · 3 comments

Comments

@Mr0Wido
Copy link

Mr0Wido commented Feb 15, 2025

I stuck with this error for two days and I can't solve it. I need help.
If ı don't use jekyll_admin, bundle exec jekyll serve works correctly. But when I added the jekyll_admin gem, got broke.

/var/lib/gems/3.1.0/gems/jekyll-admin-0.11.1/lib/jekyll/commands/serve.rb:23:in `jekyll_admin_monkey_patch': uninitialized constant Rack::Handler (NameError)

          @server.mount "/admin", Rack::Handler::WEBrick, JekyllAdmin::StaticServer
                                      ^^^^^^^^^
        from /var/lib/gems/3.1.0/gems/jekyll-admin-0.11.1/lib/jekyll/commands/serve.rb:15:in `start_up_webrick'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/lib/jekyll/commands/serve.rb:102:in `process'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/lib/jekyll/command.rb:91:in `each'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/lib/jekyll/commands/serve.rb:85:in `block (2 levels) in init_with_program'
        from /var/lib/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /var/lib/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /var/lib/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /var/lib/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /var/lib/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /var/lib/gems/3.1.0/gems/jekyll-4.4.1/exe/jekyll:15:in `<top (required)>'
        from /home/wido/gems/bin/jekyll:25:in `load'
        from /home/wido/gems/bin/jekyll:25:in `<top (required)>'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /usr/share/rubygems-integration/all/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
        from /usr/local/bin/bundle:25:in `load'
        from /usr/local/bin/bundle:25:in `<main>'
@thatnerdnoah
Copy link

I am getting this exact same error. Not sure what's causing it.

@HONEST-ZH
Copy link

so it is the same with me

@HONEST-ZH
Copy link

I guess that I find the solution to this problem. Just add this in gemfile gem "sinatra", ">= 3", "< 4".
This problem is because the dependencies of jekyll-admin. Among them, the version of sinatra should not be updated to 4.0 because it dropped support for rack 2.
See more at here

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

No branches or pull requests

3 participants