jekyll: bundler: failed to load command: jekyll

I am trying to get the latest version of jekyll working and I’ve followed the instructions listed at https://jekyllrb.com/:

gem install jekyll bundler
jekyll new my-awesome-site
cd my-awesome-site
bundle exec jekyll serve

But I run into the following error:

bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
LoadError: cannot load such file -- json
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/filters.rb:2:in `require'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/filters.rb:2:in `<top (required)>'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll.rb:82:in `require'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll.rb:82:in `<module:Jekyll>'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll.rb:36:in `<top (required)>'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/exe/jekyll:6:in `require'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/exe/jekyll:6:in `<top (required)>'
  /usr/local/bin/jekyll:23:in `load'
  /usr/local/bin/jekyll:23:in `<top (required)>'

I thought it might be because I am missing the json gem, so I ran:

gem install json

But the same error persist. I can’t seem to find any help regarding this. Any ideas what might be wrong?

Many thanks in advance,

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 38 (17 by maintainers)

Most upvoted comments

Found this previous issue - https://github.com/ffi/ffi/issues/368. The following fixed my problem:

gem uninstall ffi
gem install ffi --platform=ruby

Got it working now!

For those interested, these were the steps that I took to fix this problem:

  1. Add gem "json", "2.0.2" to the GemFile

  2. Uninstall ffi and reinstall ffi:

    gem uninstall ffi
    gem install ffi --platform=ruby
    

Thanks for your help @envygeeks, @pathawks, @ashmaroli. Really appreciate it.

We do not support OS X Ruby at all, it causes more problems than it solves now days. On OS X we ask you to use RVM or something else to install Ruby in your home directory so that you have better access to stuff, and aren’t tied down by other stuff in macOS.

As for the Linux install, your upstream provider did not install ruby-json (your Ruby did not provide an stdlib that we expect to exist.) This is a systems problem, JSON is a standard library in Ruby, and we expect it to exist and we expect your Ruby provider to provide us access to the standard library. We don’t carry JSON because of that fact. Install ruby-json or whatever it is in RPM land or add “json” to your Gemfile and the problem will resolve itself, but we won’t carry it because we expect it to be available on the system because, again, it’s a standard library.

@pathawks, no, he’s not on windows, you’ll see tht if you examine his Gemfile.lock and the paths in his error logs