jekyll-admin icon indicating copy to clipboard operation
jekyll-admin copied to clipboard

Undefined method 'rewind' - pages cannot be added

Open igorfree opened this issue 1 year ago • 4 comments

Description:

When using jekyll-admin to add a page following error occurs:

2024-05-20 11:14:45 - NoMethodError - undefined method `rewind' for #<Rackup::Handler::WEBrick::Input:0x000062d68c626ab8 @request=#<WEBrick::HTTPRequest:0x000062d68c661190 ...

this seems related to rack/issue-1972. I tried updating everything with gem update, but no difference.

Tell us a bit about yourself:

  • jekyll (4.3.3)
  • jekyll-admin (0.11.1)
  • OS: KDE Neon
  • Just in case, Node version is v20.13.1

Steps to reproduce:

create new jekyll page, with jekyll 4.3.3 add jekyll-admin plugin and try adding a new page via web GUI.

igorfree avatar May 20 '24 17:05 igorfree

I set up jekyll-admin on one machine and everything worked fine (including page creation and editing). Cloned to another machine and ran it there - all the pages are there, but the jekyll-admin interface reports "could not fetch config" and can't update or create any posts.

here's a small snippet of the error output in the terminal:

/home/vcavallo/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rackup-2.1.0/lib/rackup/handler/webrick.rb:66 (created)>>:

                request.body.rewind
                            ^^^^^^^
        /home/vcavallo/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/jekyll-admin-0.11.1/lib/jekyll-admin/server.rb:84:in `request_body'

vcavallo avatar May 30 '24 18:05 vcavallo

I managed to get it working by downgrading sinatra in the gemfile:

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

yuanworks avatar May 30 '24 19:05 yuanworks

sorry for taking so long to respond.

Downgrading sinatra as mentioned here did not resolve the issue completely.

I'm still seing the error "Could not fetch config" when going to [jekyll-site]/admin. My _config.yml is valid and contains a jekyll_admin section, jekyll_admin even displays it under the "configuration" tab.

When going to "posts" tab, I do not see my old posts. But it is possible now to create new posts, which show up normally inside the _site directory and in the jekyll_admin GUI.

Edit: when I go to the "pages" tab, I can only see very few of the pages that exist on my site. Just on random jekyll_admin seems to ignore most of the pages and only shows 3 out of 18 files present in the directory.

igorfree avatar Jul 04 '24 10:07 igorfree

The "Could not fetch config" error is showing up in another older jekyll installation which uses sinatra 3.1, so it might be an unrelated issue.

I can't confirm on the old/new posts showing as I only have a few.

yuanworks avatar Jul 04 '24 11:07 yuanworks