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 3.9.0 | Error: tried to create Proc object without a block #161

Closed
monkeywithacupcake opened this issue Dec 27, 2020 · 11 comments · Fixed by #230
Closed

jekyll 3.9.0 | Error: tried to create Proc object without a block #161

monkeywithacupcake opened this issue Dec 27, 2020 · 11 comments · Fixed by #230
Labels
bug ruby related to issues with ruby (versions, etc.)

Comments

@monkeywithacupcake
Copy link
Contributor

Acknowledge the following

  • [x ] I carefully read and followed the Getting Started guide.
  • [ x] I read through FAQ and searched through the past issues, none of which addressed my issue.
  • [x ] The issue I am raising is a potential bug in al-folio and not just a usage question.
    [For usage questions, please use gitter chat instead of raising an issue.]

Describe the bug
A clear and concise description of what the bug is.
cloned repo does not compile

To Reproduce
Steps to reproduce the behavior:

  1. Git clone repo
  2. cd al-folio
  3. bundle install
  4. bundle exec Jekyll serve
  5. get error

Expected behavior
A clear and concise description of what you expected to happen.
should serve the default site on localhost

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: Big Sur 11.0.1
  • Browser (and its version) [e.g. chrome, safari] NA Safari
  • Jekyll version [e.g. 3.8.7] 3.9.0
  • Ruby version [e.g. 2.6.5] 3.0.0

Additional context
Add any other context about the problem here.
I can serve other Jekyll sites
Problem appears to be partially due to biblography.rb call to &Proc.new but I cannot confirm. Commenting out offending code just moved the problem somewhere else.

@monkeywithacupcake
Copy link
Contributor Author

monkeywithacupcake commented Dec 28, 2020

recloned and tried again to try to follow the whole issue.

When I bundle install, there is an issue with conflicting expectations for the Jekyll version from Jekyll-scholar and GitHub-pages which results in a failure on bundle install.

Once I take care of the conflict by picking a Jekyll version and commenting out GitHub Pages, bundle install works. However, bundle exec Jekyll serve still gives an error, this time about webrick

If I update the Gemfile to specify a Jekyll version, comment out the GitHub-pages, and add the webrick gem, I can get it to work. I don't really know why, though.

Gemfile

source 'https://rubygems.org'
group :jekyll_plugins do
    #gem 'github-pages'
    gem "jekyll", "~> 4.2.0"
    gem 'jekyll-email-protect'
    gem 'jekyll-github-metadata'
    gem 'jekyll-paginate-v2'
    gem 'jekyll-scholar'
    gem 'jekyll-twitter-plugin'
    gem 'jemoji'
    gem 'unicode_utils'
    gem 'webrick'
end

@alshedivat
Copy link
Owner

It looks like your ruby version 3.0.0 is too recent. I'm able to reproduce the error with ruby 3.0.0, but it works just fine with 2.6.5. I suggest installing a different version. You can manage multiple ruby environments using rbenv.

@alshedivat alshedivat added the ruby related to issues with ruby (versions, etc.) label Dec 30, 2020
@riddhimanadib
Copy link
Contributor

Just wanted to mention, I am also facing the same issue.

@alshedivat
Copy link
Owner

@adib2149, please use ruby version 2.x instead of 3 for now. Some of the gems do not support ruby 3 as it came out just recently. I'll look into supporting ruby 3 once things stabilize later this year.

@riddhimanadib
Copy link
Contributor

@adib2149, please use ruby version 2.x instead of 3 for now. Some of the gems do not support ruby 3 as it came out just recently. I'll look into supporting ruby 3 once things stabilize later this year.

Sounds good.

@stale
Copy link

stale bot commented Mar 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 14, 2021
@postylem
Copy link

postylem commented Mar 16, 2021

I was getting the same issue.

For anyone getting here and realizing this means they finally need to look into what RVM is, this is what I ran to use the earlier ruby version, in case it's helpful. First, install RVM: \curl -sSL https://get.rvm.io | bash -s stable, then use

rvm install 2.7.2 && rvm use 2.7.2

(you can always check with ruby -v to see that you're using the version you want, also useful is rvm list)

I found that I also needed to add a line in my Gemfile to specify the jekyll version, because something in jekyll v3.8 and higher seems to be incompatible with jekyll-scholar. Downgrading like this solved my issue:

group :jekyll_plugins do
    # ....
    gem 'jekyll', '3.7.3' # <-- this line
    # ....
end

Then I re-ran

bundle install

With Ruby v2.7.2 and jekyll v3.7.3, I did not run into the issue anymore.

@stale stale bot removed the wontfix label Mar 16, 2021
@monkeywithacupcake
Copy link
Contributor Author

If you don't use RVM or you just want to use ruby3 for any other reason, my changes to the gemfile did make it work for me. It might work for you that way as well.

@alshedivat
Copy link
Owner

@monkeywithacupcake, good point, it looks like ruby3 could work if you remove github-pages (github/pages-gem#752) and add webrick (as you did). Technically, github-pages is unnecessary for the current workflow.

@AhmedSalih3d
Copy link

AhmedSalih3d commented Feb 26, 2024

Hey guys, 2 years later this is still an issue. Was it ever fixed?

Using ruby 3.0, jekyll-scholar does not work.

Kind regards

EDIT: Finally got to the bottom of it, thanks to the responses above.

One can not use github-pages since it limits the version of Jekyll to 3.9.5 atm and thereby requires ruby to be of version 2.7.2. This sucks.

Instead one should remove github-pages and add 'jekyll-github-metadata' + 'jekyll-scholar' of course.

Then one will see some render errors, if the .md files do not have front matter in them, at minimum:

"---
---"

At the top of the file should be included.

Then in your _layouts folder, you probably have a default.html defined. Inside of the front matter of md files write:

"---
layout: default
---"

Now you get github pages rendering, thanks github-metadata and you get jekyll-scholar working and everything is great!

Now you can use ruby 3.0 too!

Took me two hours, hopefully saves someone 2 hours in the future finding this.

Kind regards

@george-gca
Copy link
Collaborator

Or you could update your code to the latest version of the template. As you can see here it builds the site using ruby 3.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ruby related to issues with ruby (versions, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants