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

Initialize source_dir in ThemeDataReader #39

Closed
jorgeecardona opened this issue Jan 15, 2021 · 2 comments · Fixed by #38
Closed

Initialize source_dir in ThemeDataReader #39

jorgeecardona opened this issue Jan 15, 2021 · 2 comments · Fixed by #38

Comments

@jorgeecardona
Copy link

Hi,

I am sorry for the raw issue; I am not a ruby native. I was building my blog and run into problems with jekyll 4.2.0. The class data_reader has a @source_dir that needs to be initialized, in your code you inherit from that class but don't initialize the variable that is then used but is nil, so path.sub raise an error.

	11: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:65:in `build'
	10: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:28:in `process_site'
	 9: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:78:in `process'
	 8: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:181:in `read'
	 7: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/reader.rb:18:in `read'
	 6: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/reader.rb:29:in `read_theme_data'
	 5: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/theme_data_reader.rb:17:in `read'
	 4: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/theme_data_reader.rb:28:in `read_data_to'
	 3: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/theme_data_reader.rb:28:in `each'
	 2: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-data-1.1.0/lib/jekyll-data/theme_data_reader.rb:36:in `block in read_data_to'
	 1: from /home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/readers/data_reader.rb:61:in `read_data_file'
/home/who/blog/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/readers/data_reader.rb:61:in `sub': wrong argument type nil (expected Regexp) (TypeError)

That new variable(?) was added here (just 2 months ago): jekyll/jekyll#8481

I hope this helps.

@ashmaroli
Copy link
Owner

I'll try to ship a new version soon. Until then, you may point your Gemfile to this GitHub repository:

gem 'jekyll-data', github: 'ashmaroli/jekyll-data'

@ronaldtse
Copy link

Hi @ashmaroli , we are encountering the same issue across several sites. Would the release occur soon? Thank you for the great gem!

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 a pull request may close this issue.

3 participants