Help with Jekyll Error

Hello,

I am a beginner working with Jekyll. I have installed Jekyll and Ruby by following the instruction on the website. But when I was trying to run the jekyll build and jekyll -v on my terminal I received the error message below

Ignoring ffi-1.11.1 because its extensions are not built. Try: gem pristine ffi --version 1.11.1
Ignoring http_parser.rb-0.6.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.6.0
Ignoring sassc-2.2.1 because its extensions are not built. Try: gem pristine sassc --version 2.2.1
Traceback (most recent call last):
	21: from /Users/H.QIAN/gems/bin/jekyll:23:in `<main>'
	20: from /Users/H.QIAN/gems/bin/jekyll:23:in `load'
	19: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-4.0.0/exe/jekyll:8:in `<top (required)>'
	18: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	17: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	16: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `<top (required)>'
	15: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	14: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	13: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	12: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	11: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	10: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	 9: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 8: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 7: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<top (required)>'
	 6: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `require_relative'
	 5: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<top (required)>'
	 4: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 3: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 2: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/ffi-1.11.1/lib/ffi.rb:4:in `<top (required)>'
	 1: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- 2.6/ffi_c (LoadError)
	22: from /Users/H.QIAN/gems/bin/jekyll:23:in `<main>'
	21: from /Users/H.QIAN/gems/bin/jekyll:23:in `load'
	20: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-4.0.0/exe/jekyll:8:in `<top (required)>'
	19: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	18: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	17: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-4.0.0/lib/jekyll.rb:206:in `<top (required)>'
	16: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	15: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	14: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	13: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	12: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	11: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.0.1/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	10: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 9: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 8: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `<top (required)>'
	 7: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc.rb:31:in `require_relative'
	 6: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/native.rb:3:in `<top (required)>'
	 5: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 4: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 3: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/ffi-1.11.1/lib/ffi.rb:3:in `<top (required)>'
	 2: from /Users/H.QIAN/.gem/ruby/2.6.0/gems/ffi-1.11.1/lib/ffi.rb:6:in `rescue in <top (required)>'
	 1: from /Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/H.QIAN/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': incompatible library version - /Users/H.QIAN/.gem/ruby/2.6.0/gems/ffi-1.11.1/lib/ffi_c.bundle (LoadError)

Would really need help in how to troubleshoot this problem as this is my first time using it and I have not much experience on command line coding as well.

Thank you in advance!

what OS?

part of the problem may be that you have ruby installed in 2 places, been seeing that a lot lately, I don’t know for sure that it is a problem but it seems bad to me.

How did you install ruby? and jekyll? using bundler?

@rdyar Thanks for your response! I am using Mac OS.

yes I think on Mac there is a local Ruby on the machine and I updated it to the latest version of ruby.

I did tried several method to install ruby and gems and also jekyll. I tried to install a new gem yesterday by this command gem install ffi and now my jekyll seems working I guess.

Here is the result when I try to run jekyll build and jekyll -v

jekyll build
Configuration file: none
Source: /Users/H.QIAN
Destination: /Users/H.QIAN/_site
Incremental build: disabled. Enable with --incremental
Generating…
------------------------------------------------
Jekyll 4.0.0 Please append --trace to the build command
for any additional information or backtrace.
------------------------------------------------
(base) tans-MacBook-Pro:~ H.QIAN$ jekyll -v
jekyll 4.0.0

So I am guessing it is working now? What’s your thought? I am still figuring out how to build the jekyll for now, but want to make sure everything works.

@rdyar
And I tried to do this command jekyll build --trace it shows me a message as below, saying that the error name is too long
What can I do?
Also, in regards of my ruby, I have found my ruby files on my machine, there is three different versions of Ruby in my machine.

/Users/H.QIAN/.gem/ruby/2.6.0/gems/jekyll-4.0.0/lib/jekyll/utils.rb:141:in `initialize’: File name too long @ rb_sysopen - /Users/H.QIAN/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper EH.app/Contents/MacOS/Steam Helper EH ( Errno::ENAMETOOLONG )

hmmm, haven’t seen that before.
So does jekyll work? can you view the site?

Sometimes the path is part of the filename total length, I have had issues in another application due to the path + filename being too long but in the context of jekyll that seems odd. But if the ruby stuff is buried in a deep folder/path location I could see it being a problem. I think the problem I had was the total character count of the path was more than 256. Again that was not with jekyll, something totally different.

I am not 100% sure how to start a new site. I have viewed different website and the one from github but not sure if they are the right one. Do you mind to show me how I can try to see if my Jekyll is working? Thanks in advance!

got to a folder on your computer, open the command window and type:

jekyll new testsite --blank

it should make a folder called testsite with a simple site in it (no theme). Then cd into that folder and do:

jekyll serve

Oh it works without any error! But how can I use it on other themes and how to connect it to github page?

I just did it that way as it is simpler.
To use a theme you’ll need to read the docs a bit.

If you have no site right now and are starting from scratch I would download the actual repo of a theme you like and remove all the stuff you don’t need and starting building.

You can also just use the default minima theme which comes with a default new site which is just:

jekyll new name-of-my-site

You can do that and then change the theme in the config I think? I am not a theme person so not real sure on all that but there should be enough docs to get you going.

To get it on GH you’ll need to read the docs, or search youtube. Not too hard but a little complicated and off the top of my head I can’t type it up.

1 Like

I see. Well thanks a lot for all your input! Do you know if it is possible to downgrade my jekyll too?

Sorry so what is the different between bundle exec jekyll serve and jekyll serve?

I ran both and the bundle exec jekyll serve is not working for me at all. But the jekyll serve works.

well, bundler is the recommended way to do it but I don’t use it as I find it too complicated and I don’t have issues without it.

I think that the idea with bundler is to keep all your dependencies in sync. So you have a gemfile.lock(?) which lists all needed versions of all gems for your site, bundle install then installs all those and bundle execute uses just what is specified in the gem lock file? something like that.

Skipping bundler on a simple non-theme site eliminates some things that can screw you up. But bundler is likely needed for some projects.

Bundler is handy for larger sites with lots of specific dependencies as it keeps everything in sync so someone else could build the site on a different computer and get the same exact setup as the first person.

I don’t use it, and don’t use a gem lock file, and have no issues. I also don’t use any plugins and don’t use a theme.

I think one of the issues with bundler may be it is installing its own version or ruby? not sure about that though. Most people seem to use bundler and have no problems, and it is recommended. But it is not required I don’t think.

Oh your explanation really clears up a lot of information for me. So, (if I want to use bundler) I will have to install bundler on the new jekyll directory I have made, then do bundle exec jekyll serve?
Then how about git-hub page gems? I am not sure if I have it on my machine and can not find a way to download it.

when you use bundler you have to do bundle install (once unless the gems change) to install all the dependencies and then bundle exec jekyll serve to serve the site.

i don’t bother with the GH gem, not sure you really need it. basic jekyll is pretty close to the same thing as what GH is running. I wouldn’t worry too much about that unless you run into an issue.

I try to keep everything as simple as possible and have not done much with trying to setup the exact GH setup. I think there is a way to do that all at once but not sure where I saw that.

Gotcha! Thanks for the information again. Sorry for the last question, I have, do you know where can I troubleshoot the problem with the page?
I uploaded the new test jekyll site to github and the web page does not show properly.


this is the link

that is the most common GH issue, css is not loading cause you didn’t set the baseurl in the config file. GH projects don’t server from the root, they serve from a subfolder that is your project name, but without the baseulr the css is looking in the root. So a GH project usually needs the baseurl set in the config file to the name of the project with a trailing slash.

yours looks like it should be baseurl: blog-2/

Got it! Thanks for your help! I will do more google search and better search too. Thanks again