An error occurred while installing yajl-ruby (1.2.0), and Bundler cannot 127 continue


After moving an old Jekyll site from running in a Docker container to running directly in the GitLab environment, I am stuck on the bug below - any help about how to resolve the problem would be greatly appreciated! (I tried using v1.2.0 instead of the original v1.1.2 but got the same result).


 Running with gitlab-runner 12.8.0 (1b659122)
   on docker-auto-scale 0277ea0f
Using Docker executor with image ruby:latest ...
 Pulling docker image ruby:latest ...
 Using docker image sha256:556e761e192c4354fc0477020ca4c1bc70908e14040e61d82204a2a8b05e49a6 for ruby:latest ...
Running on runner-0277ea0f-project-17249470-concurrent-0 via runner-0277ea0f-srm-1583214053-738b3938...
 Fetching changes with git depth set to 50...
 Initialized empty Git repository in /builds/philip_rhoades/lev/.git/
 Created fresh repository.
  * [new ref]         refs/pipelines/122721331 -> refs/pipelines/122721331
  * [new branch]      master                   -> origin/master
 Checking out f947c89f as master...
 Skipping Git submodules setup
$ gem install bundler
 Successfully installed bundler-2.1.4
 1 gem installed
 $ bundle update jekyll-watch
 Fetching gem metadata from
 Fetching gem metadata from
 Resolving dependencies...
 Fetching blankslate
 Installing blankslate
 Using bundler 2.1.4
 Fetching fast-stemmer 1.0.2
 Installing fast-stemmer 1.0.2 with native extensions
 Fetching classifier-reborn 2.0.3
 Installing classifier-reborn 2.0.3
 Fetching coffee-script-source 1.9.1
 Installing coffee-script-source 1.9.1
 Fetching execjs 2.4.0
 Installing execjs 2.4.0
 Fetching coffee-script 2.3.0
 Installing coffee-script 2.3.0
 Fetching colorator 0.1
 Installing colorator 0.1
 Fetching ffi 1.12.2 (was 1.9.8)
 Installing ffi 1.12.2 (was 1.9.8) with native extensions
 Fetching jekyll-coffeescript 1.0.1
 Installing jekyll-coffeescript 1.0.1
 Fetching jekyll-gist 1.2.1
 Installing jekyll-gist 1.2.1
 Fetching jekyll-paginate 1.1.0
 Installing jekyll-paginate 1.1.0
 Fetching sass 3.4.13
 Installing sass 3.4.13
 Fetching jekyll-sass-converter 1.3.0
 Installing jekyll-sass-converter 1.3.0
 Fetching rb-fsevent 0.10.3 (was 0.9.4)
 Installing rb-fsevent 0.10.3 (was 0.9.4)
 Fetching rb-inotify 0.10.1 (was 0.9.5)
 Installing rb-inotify 0.10.1 (was 0.9.5)
 Fetching listen 3.2.1 (was 2.10.0)
 Installing listen 3.2.1 (was 2.10.0)
 Fetching jekyll-watch 1.5.1 (was 1.2.1)
 Installing jekyll-watch 1.5.1 (was 1.2.1)
 Fetching kramdown 1.6.0
 Installing kramdown 1.6.0
 Fetching liquid 2.6.2
 Installing liquid 2.6.2
 Fetching mercenary 0.3.5
 Installing mercenary 0.3.5
 Fetching posix-spawn 0.3.10
 Installing posix-spawn 0.3.10 with native extensions
 Fetching yajl-ruby 1.2.0
 Installing yajl-ruby 1.2.0 with native extensions
 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
     current directory: /usr/local/bundle/gems/yajl-ruby-1.2.0/ext/yajl
 /usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r
 ./siteconf20200303-19-ybh4p2.rb extconf.rb
 creating Makefile
 current directory: /usr/local/bundle/gems/yajl-ruby-1.2.0/ext/yajl
 make "DESTDIR=" clean
 current directory: /usr/local/bundle/gems/yajl-ruby-1.2.0/ext/yajl
 make "DESTDIR="
 compiling yajl.c
 compiling yajl_alloc.c
 compiling yajl_buf.c
 compiling yajl_encode.c
 compiling yajl_ext.c
 yajl_ext.c: In function ‘rb_yajl_parser_parse’:
 yajl_ext.c:472:17: warning: variable ‘stat’ set but not used
      yajl_status stat;
 In file included from /usr/local/include/ruby-2.7.0/ruby.h:33,
                  from yajl_ext.h:32,
                  from yajl_ext.c:24:
 yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’:
 yajl_ext.c:882:22: error: ‘rb_cFixnum’ undeclared (first use in this function);
 did you mean ‘rb_isalnum’?
 rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json,
 /usr/local/include/ruby-2.7.0/ruby/ruby.h:2799:104: note: in definition of macro
 #define rb_define_method(klass, mid, func, arity)
 yajl_ext.c:882:22: note: each undeclared identifier is reported only once for
 each function it appears in
 rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json,
 /usr/local/include/ruby-2.7.0/ruby/ruby.h:2799:104: note: in definition of macro
 #define rb_define_method(klass, mid, func, arity)
 yajl_ext.c: At top level:
 cc1: warning: unrecognized command line option ‘-Wno-self-assign’
 cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
 cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
 make: *** [Makefile:245: yajl_ext.o] Error 1
 make failed, exit code 2
 Gem files will remain installed in /usr/local/bundle/gems/yajl-ruby-1.2.0 for
 Results logged to
 An error occurred while installing yajl-ruby (1.2.0), and Bundler cannot
 Make sure that `gem install yajl-ruby -v '1.2.0' --source
 ''` succeeds before bundling.
 In Gemfile:
   octopress was resolved to 3.0.0.rc.35, which depends on
     octopress-escape-code was resolved to 2.0.6, which depends on
       octopress-hooks was resolved to 2.6.0, which depends on
         jekyll was resolved to 2.5.3, which depends on
           pygments.rb was resolved to 0.6.3, which depends on
 ERROR: Job failed: exit code 1

what is in your ci file?

it looks like the ruby install doesn’t include dev tools so it cannot create the native extensions.

Here is one of my ci files, though I am not sure when it last ran, haven’t checked it lately, but I think it works:

image: ruby:2.4

  - gem install jekyll
  - jekyll build -d public
    - public
  - master

@rdyar ,

Thanks for responding - mine is not much different:

image: ruby:latest

  JEKYLL_ENV: production

  - gem install bundler
  - bundle update jekyll-watch

  stage: test
  - bundle exec jekyll build -d test
    - test
  - master

  stage: deploy
  - bundle exec jekyll build -d public
    - public
  - master

what is in your gem file? kind of looks like you are using a really old version of jekyll?

I don’t think that is your actual problem, still think that is a ruby/devtools problem.

I would change the ruby version to 2.4 rather than latest which looks like it is using 2.7.

@rdyar ,


source ''

gem 'jekyll'
gem 'jekyll-sitemap'
gem 'octopress', '~> 3.0.0.rc.12'


    blankslate (
    celluloid (0.16.0)
      timers (~> 4.0.0)
    classifier-reborn (2.0.3)
      fast-stemmer (~> 1.0)
    coffee-script (2.3.0)
    coffee-script-source (1.9.1)
    colorator (0.1)
    execjs (2.4.0)
    fast-stemmer (1.0.2)
    ffi (1.9.8)
    ffi (1.9.8-x64-mingw32)
    ffi (1.9.8-x86-mingw32)
    hitimes (1.2.2)
    hitimes (1.2.2-x86-mingw32)
    jekyll (2.5.3)
      classifier-reborn (~> 2.0)
      colorator (~> 0.1)
      jekyll-coffeescript (~> 1.0)
      jekyll-gist (~> 1.0)
      jekyll-paginate (~> 1.0)
      jekyll-sass-converter (~> 1.0)
      jekyll-watch (~> 1.1)
      kramdown (~> 1.3)
      liquid (~> 2.6.1)
      mercenary (~> 0.3.3)
      pygments.rb (~> 0.6.0)
      redcarpet (~> 3.1)
      safe_yaml (~> 1.0)
      toml (~> 0.1.0)
    jekyll-coffeescript (1.0.1)
      coffee-script (~> 2.2)
    jekyll-gist (1.2.1)
    jekyll-paginate (1.1.0)
    jekyll-sass-converter (1.3.0)
      sass (~> 3.2)
    jekyll-sitemap (0.8.1)
    jekyll-watch (1.2.1)
      listen (~> 2.7)
    kramdown (1.6.0)
    liquid (2.6.2)
    listen (2.10.0)
      celluloid (~> 0.16.0)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    mercenary (0.3.5)
    octopress (3.0.0.rc.35)
      jekyll (~> 2.5)
      mercenary (~> 0.3.2)
      octopress-escape-code (~> 2.0)
      octopress-hooks (~> 2.0)
    octopress-deploy (1.2.0)
    octopress-escape-code (2.0.6)
      octopress-hooks (~> 2.0)
    octopress-hooks (2.6.0)
      jekyll (~> 2.0)
    parslet (1.5.0)
      blankslate (~> 2.0)
    posix-spawn (0.3.10)
    pygments.rb (0.6.3)
      posix-spawn (~> 0.3.6)
      yajl-ruby (1.2.0)
    rb-fsevent (0.9.4)
    rb-inotify (0.9.5)
      ffi (>= 0.5.0)
    redcarpet (3.2.2)
    safe_yaml (1.0.4)
    sass (3.4.13)
    timers (4.0.1)
    titlecase (0.1.1)
    toml (0.1.2)
      parslet (~> 1.5.0)
    yajl-ruby (1.2.0)  # started as 1.1.2


  octopress (~> 3.0.0.rc.12)

Yep - until my Docker server crashed, it had been in use in a container for a long time . .


Same result with 2.4 . .


is your site doing anything special? I would try it with the current version and see what happens.

I would rename gemfile.lock so it is not used and see what happens. Like gemfile.lock.old.

Why octopress? are you using octopress? it doesn’t look like it is being developed any more, looks like it has been dormant for ~4-5 years.

Maybe the problem is that all your dependencies are really old yet you are using newer ruby. Maybe an older version of ruby would work better?

Not as far as I know - this was just a Jekyll Theme that I liked and suited my needs at the time so I just used and changed the images and text . . that’s why I used “latest” for Ruby version - I might be able to go back to that - see below.

Yes! I had to also change:

- bundle update jekyll-watch


- bundle install

but it worked! - well, almost - it is only missing CSS formatting I think - but progress!

Again, this is just what was used when grabbed it and just changed images and text for my purpose - yes, that is about how long ago I got this site going.

Well it is 2.4 ATM but I could go earlier - but now it appears that it is just a CSS problem?

@rdyar ,

Fixing the the url and baseurl fixed the CSS problem - the only minor issue now is some images are not displaying but I think they will come back after I setup the GitLab URL hosting properly . .

I will post a working URL here as soon as it is going - just for completeness . .

Thanks so much!