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

incompatible with sinatra 4.0 / rack 3.0 #705

Open
namiwang opened this issue Feb 6, 2024 · 2 comments
Open

incompatible with sinatra 4.0 / rack 3.0 #705

namiwang opened this issue Feb 6, 2024 · 2 comments

Comments

@namiwang
Copy link

namiwang commented Feb 6, 2024

After upgrading sinatra (which jekyll-admin depends on) to 4.0, got the following error when staring server

bundler: failed to load command: jekyll (/Users/nami/.asdf/installs/ruby/3.2.2/bin/jekyll)
<internal:/Users/nami/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rack/handler (LoadError)
	from <internal:/Users/nami/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/nami/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.11.1/lib/jekyll/commands/serve.rb:23:in `jekyll_admin_monkey_patch'
	from /Users/nami/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.11.1/lib/jekyll/commands/serve.rb:15:in `start_up_webrick'
...

The root cause is sinatra 4 dropped support for rack 2

refs:

A workaround is to add gem "rackup" to Gemfile.

A simple fix would be limiting spec.add_dependency "sinatra", ">= 1.4", "< 4.0" in gemspec, or adding rackup as a direct dependency.

@kebugcheckex
Copy link

Github Dependabot sent me multiple security alerts regarding rack version used in jekyll-admin. rack should be upgraded to at least 2.2.8.1. Upgrading sinatra to 4 will solve the problem.

@yuanworks
Copy link

yuanworks commented May 30, 2024

@namiwang unfortunately your fix (adding rackup gem) doesn't let me save new pages inside the admin because of the following error:

 NoMethodError - undefined method `rewind' for #<Rackup::Handler::WEBrick::Input

I managed to get both admin and saving files working by downgrading sinatra:

gem "sinatra", ">= 3", "< 4"

Edit: issue mentioned here too #709

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