Jekyll: Liquid Exception: failed to allocate memory in <file> - jekyll

I'm running Jekyll 3.5.1, Liquid 4.0.0, Ruby 2.2 on Windows 7.
When I run jekyll serve. It throws the below error.
Liquid Exception: failed to allocate memory in <file>
I've reinstalled Ruby, Jekyll and Liquid, but in vain. Any idea on how to fix this?
Update: I tried this on a different machine. Now, it throws the below error.
Liquid Exception: string sizes too big in <file>
jekyll 3.4.5 | Error: string sizes too big
It seems like problem lies in my code. Not sure, where I'm going wrong here.

Related

jekyll serve throws 'no implicit conversion of Hash into Integer ' error

I am following Michael Hartl's Learn Enough CSS course. My current folder layout is as follow:
- _layouts
- _site
index.html
where index.html is:
---
layout: test
---
and I have test.html in _layouts as:
Hello again, world.
Whenever I run jekyll serve, I get this error:
Error reading file /Users/pj/Documents/LETGD/repos/pohjie.github.io/_layouts/test.html: no implicit conversion of Hash into Integer
Error reading file /Users/pj/Documents/LETGD/repos/pohjie.github.io/index.html: no implicit conversion of Hash into Integer
Does anyone have any idea what's happening? I'm using M1 MacBook, not sure if that is a possible cause as I spent a lot of time install Ruby as well.
Thanks!
While downgrading certainly works, it may be pretty annoying and (depending on where you need this) problematic. If you just want a simple workaround, you can make use of the fact that jekyll build still works with Ruby 3 and just serve the page separately:
bundler exec jekyll build && bash -c 'cd _site && python -m http.server 3000'
The only downside of this is that you lose the automatic reload. If you change anything, you need to restart jekyll. But you can run this in a Ruby 3 environment without fiddling with the environment itself.
Quoting from this source:-
Github-Pages uses Jekyll 3.9, which isn’t compatible with Ruby 3.
Downgrading to Ruby 2.7 should avoid the problem.
This worked for me.
Downgrading to Ruby 2.7 is an option (as others have said) which I didn't feel like doing, so I did this instead:
Apply the patch to pathutil
From Liviu Stefan's answer:
Ruby 3.0 deprecated using the last argument as keyword parameters. A double splat ** has to be added before the variable for the behavior to be supported.
Here's how I applied the patch locally:
sudo sed -i.bak 's/, kwd/, **kwd/' $(gem which pathutil)
After that I got another error:
/var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
Which I fixed by running (from bundle exec jekyll serve: cannot load such file):
bundle add webrick
Ruby 3.0 deprecated using the last argument as keyword parameters. A double splat ** has to be added before the variable for the behavior to be supported.
It's fairly straightforward to amend locally; the relevant patch is found: here
Which needs to be applid to:
/home/<your_user_name>/gems/gems/pathutil-0.16.2/lib/pathutil.rb

make failed, uncaught signal 11 error when installing Jekyll

make failed, uncaught signal 11
Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/http_parser.rb-0.6.0/gem_make.out
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Done installing documentation for bundler after 4 seconds
1 gem installed
C:\Users\ryan1>jekyll -v
'jekyll' is not recognized as an internal or external command,
operable program or batch file.
Sometimes, in the late hours of the night, the jekyll command is aliased to hyde. And of those times, sometimes it will respond to your request pleasantly and run as expected, but other times it can be quite unfriendly. When that happens, I usually wait until morning and then try again when it's behaving better.
That or the executable is missing from your path. Which is the case here? Who can say? But it's probably the first one.

How to solve Jekyll-Include-Cache issue?

I am currently trying to open an already created website made through Jekyll. I use the cd command through the terminal to get to the website file that I pulled from Github. Once I get to the file, I run bundle exec Jekyll serve and it shows this error message:
Dependency Error: Yikes! It looks like you don't have Jekyll-include-cache or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- Jekyll-include-cache' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
Jekyll 3.8.5 | Error: Jekyll-include-cache
So I then do gem install Jekyll-include-cache and the issue remains. Does anyone know how to fix this??
The error message means that Jekyll couldn't load the plugin properly.
Ensure that you have listed the plugin in your Gemfile:
# Gemfile
gem "jekyll-include-cache"

Getting an error with Jekyll serve

Have basically nothing but a _config.yml and index.md file, and when running jekyll serve I'm getting this:
D, [2015-07-08T10:33:29.810161 #14194] DEBUG -- : Celluloid 0.17.0 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
jekyll 2.5.3 | Error: wrong number of arguments (2 for 1)
Please help!
I'm not 100% sure this is the answer for you since I wasn't using Jekyll but I had the same error when I was trying to use compass watch.
Rolling back both Celluloid and Listen did the trick for me.
I added the following to my gemfile:
gem 'listen', '<2.10.0'
gem 'compass', '<0.17.0'

Hudson: Error after creating doxygen files; downgrade not working either

I'm having the following problem with Hudson after upgrading to 2.1.0:
After successfully creating the doxygen output, the following exception occurs:
Publishing Doxygen HTML results.
The determined Doxygen directory is 'C:/doxy/myDir'.
FATAL: error
hudson.util.IOException2: java.io.IOException: Unconnected pipe
The error did not occur with 2.0.1, unfortunately, downgrading does not work - Hudson tells me, that it can't read the job files anymore.
Does anyone know the best way to deal with this? Is there a simple solution to either make the doxygen plugin work in 2.1.0 or to successfully downgrade to 2.0.1?
Not sure what exactly the problem was, but migrating to the newest Jenkins release and using the HTML report publisher plugin instead of the Doxygen plugin is at least a work