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

bundler: failed to load command: jekyll #5423

Closed
tinyheero opened this issue Sep 28, 2016 · 38 comments

Comments

@tinyheero
Copy link

commented Sep 28, 2016

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,

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

Hi,
Did jekyll install correctly? You can check by running:

$ jekyll --version

If that's all fine, then try running

$ bundle install

right after you cd into the new blog directory.

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Hi,

When I run:

$ jekyll --version
jekyll 3.2.1

So I think jekyll is installed correctly. When I do the following;

$ cd my-awesome-site
$ bundle install
Rubygems 2.0.14 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using colorator 1.1.0
Using ffi 1.9.14
Using forwardable-extended 2.6.0
Using sass 3.4.22
Using rb-fsevent 0.9.7
Using kramdown 1.12.0
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using minima 1.2.0
Using bundler 1.13.1
Using rb-inotify 0.9.7
Using pathutil 0.14.0
Using jekyll-sass-converter 1.4.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using jekyll 3.2.1
Bundle complete! 2 Gemfile dependencies, 18 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Then I tried:

$ bundle exec jekyll serve

But got the same 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)>'
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

I guess it could be due to the older version of Rubygems, try:

$ gem update --system
@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Tried

$ gem update --system

This updated to RubyGems 2.6.7. Then I ran

gem update

And then ran:

$ bundle exec jekyll serve

But still no success...same error. If it helps, this is my ruby version:

$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

have never tested with Ruby 2.0.0, so dont know if that's the cause. But to check if all required gems have been installed, can you post the contents of your Gemfile.lock

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Sure.

$ cat ~/my-awesome-site/Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    colorator (1.1.0)
    ffi (1.9.14)
    forwardable-extended (2.6.0)
    jekyll (3.2.1)
      colorator (~> 1.0)
      jekyll-sass-converter (~> 1.0)
      jekyll-watch (~> 1.1)
      kramdown (~> 1.3)
      liquid (~> 3.0)
      mercenary (~> 0.3.3)
      pathutil (~> 0.9)
      rouge (~> 1.7)
      safe_yaml (~> 1.0)
    jekyll-sass-converter (1.4.0)
      sass (~> 3.4)
    jekyll-watch (1.5.0)
      listen (~> 3.0, < 3.1)
    kramdown (1.12.0)
    liquid (3.0.6)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    mercenary (0.3.6)
    minima (1.2.0)
    pathutil (0.14.0)
      forwardable-extended (~> 2.6)
    rb-fsevent (0.9.7)
    rb-inotify (0.9.7)
      ffi (>= 0.5.0)
    rouge (1.11.1)
    safe_yaml (1.0.4)
    sass (3.4.22)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll (= 3.2.1)
  minima

RUBY VERSION
   ruby 2.0.0p598

BUNDLED WITH
   1.13.1
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

Interesting.. apart from Ruby, all the dependencies are there and up to date, and you say you installed json successfully as well... 💭

Did json get updated after you updated rubygems?

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

I don't actually recall if json was also updated unfortunately...I didn't track the version number before and after. Is there a way to check?

Another thing worth mentioning was that I had jekyll installed and working before. This was before the switch to bundler? This seems new to me at least because I don't recall having to do this in the past. So there might be some hidden conflicts happening that I am not aware of?

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

If json --version shows 2.0.2 then its up-to-date.
bundler works with even Ruby1.8.7 so that cant be it..

bundler was introduced to have jekyll serve in the context of your Gemfile. Running simply jekyll serve still works.

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Interesting...this might be the problem:

$ gem install json
Building native extensions.  This could take a while...
Successfully installed json-2.0.2
Parsing documentation for json-2.0.2
Done installing documentation for json after 1 seconds
1 gem installed

Then when I run:

$ json --version
bash: json: command not found...

Seems like the json is being install somewhere not in my PATH. Also when I run jekyll serve, I get these errors:

$ jekyll serve
WARN: Unresolved specs during Gem::Specification.reset:
      listen (< 3.1, ~> 3.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /home/fong/my-awesome-site/_config.yml
            Source: /home/fong/my-awesome-site
       Destination: /home/fong/my-awesome-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.432 seconds.
/usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:6:in `require': cannot load such file -- ffi_c (LoadError)
    from /usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:6:in `rescue in <top (required)>'
    from /usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:3:in `<top (required)>'
    from /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `require'
    from /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `<top (required)>'
    from /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `require'
    from /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `<top (required)>'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/linux.rb:30:in `require'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/linux.rb:30:in `_configure'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
    from /usr/local/share/gems/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
    from /usr/local/share/gems/gems/jekyll-watch-1.5.0/lib/jekyll/watcher.rb:24:in `watch'
    from /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:79:in `call'
    from /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:79:in `watch'
    from /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:41:in `process'
    from /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/serve.rb:36:in `block (2 levels) in init_with_program'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `call'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /home/fong/.gem/ruby/gems/jekyll-3.2.1/exe/jekyll:13:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>
@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

$ json --version
bash: json: command not found...

This could be because json probably doesnt understand that command.

/cc @pathawks over to you buddy, I'm not able to identify the cause

@pathawks

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

Try

bundle update
bundle exec jekyll build

What happens?

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Same error unfortunately:

$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using colorator 1.1.0
Using ffi 1.9.14
Using forwardable-extended 2.6.0
Using sass 3.4.22
Using rb-fsevent 0.9.7
Using kramdown 1.12.0
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using minima 1.2.0
Using bundler 1.13.1
Using rb-inotify 0.9.7
Using pathutil 0.14.0
Using jekyll-sass-converter 1.4.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using jekyll 3.2.1
Bundle updated!

$ bundle exec jekyll build
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)>'
@pathawks

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

Are you on Windows, by chance?

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

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

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Here's my OS details if it helps:

$ cat /etc/*elease
CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.2.1511 (Core)
CentOS Linux release 7.2.1511 (Core)
@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

For what it's worth, it works on my local macbook. But when I try these jekyll commands on a shared linux machine this is what happens...

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Sep 28, 2016

is the ruby version on your macbook 2.0.0 as well?

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

On mac:

$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

On linux:

$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
@envygeeks

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2016

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.

@envygeeks

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2016

On the FFI-C issue, you need to install libffi on the system so that FFI can attach some bindings.

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Thanks for the comment. This helped a bit. I think ruby-json is actually already installed? Because:

gem install json

Works fine and based on what I read on online, ruby-json stdlib should bundled with ruby-devel

sudo yum install ruby-devel

Reveals that it is already installed. What I did was add the following line to my ~/my-awesome-site/Gemfile

gem "json", "2.0.2"

When trying to run:

$ bundle exec jekyll serve
Configuration file: /home/fong/my-awesome-site/_config.yml
            Source: /home/fong/my-awesome-site
       Destination: /home/fong/my-awesome-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.337 seconds.
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
LoadError: cannot load such file -- ffi_c
  /usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:6:in `require'
  /usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:6:in `rescue in <top (required)>'
  /usr/local/share/gems/gems/ffi-1.9.14/lib/ffi.rb:3:in `<top (required)>'
  /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `require'
  /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify/native.rb:1:in `<top (required)>'
  /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `require'
  /usr/local/share/gems/gems/rb-inotify-0.9.7/lib/rb-inotify.rb:1:in `<top (required)>'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/linux.rb:30:in `require'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/linux.rb:30:in `_configure'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
  /usr/local/share/gems/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
  /usr/local/share/gems/gems/jekyll-watch-1.5.0/lib/jekyll/watcher.rb:24:in `watch'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:79:in `call'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:79:in `watch'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/build.rb:41:in `process'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/lib/jekyll/commands/serve.rb:36:in `block (2 levels) in init_with_program'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `call'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
  /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
  /home/fong/.gem/ruby/gems/jekyll-3.2.1/exe/jekyll:13:in `<top (required)>'
  /usr/local/bin/jekyll:23:in `load'
  /usr/local/bin/jekyll:23:in `<top (required)>'

This seems to get around the json issue. But now the issue is related to libffi. When I tried to install libffi as you suggested:

$ sudo yum install libffi`
Package libffi-3.0.13-16.el7.x86_64 already installed and latest version

So it seems that is already installed, but is not finding it now.

@tinyheero

This comment has been minimized.

Copy link
Author

commented Sep 28, 2016

Found this previous issue - ffi/ffi#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.

@pathawks pathawks closed this Sep 28, 2016
@zyfdegh

This comment has been minimized.

Copy link

commented Dec 27, 2016

+1 Exactly the same issue on CentOS 7.3.1611 and Ruby ruby 2.0.0p648 (2015-12-16) [x86_64-linux], but I did not fix the error although I followed the final solution 1,2,3. I prefer Golang and I'm about to using Hugo now.

@Nefari0uss

This comment has been minimized.

Copy link

commented Jan 12, 2017

@tinyheero You solution also solved my problem. Jekyll v3.3.1, using Chruby and Ruby v2.4.0

@atugade

This comment has been minimized.

Copy link

commented Jan 15, 2017

Yeah, same thing on on CentOS Linux release 7.2.1511 (Core) and ruby 2.0.0p648 (2015-12-16) [x86_64-linux]. @zyfdegh Thanks for the tip on Hugo, went through their github pages tutorial and is straight forward and just works.

@pedromarins

This comment has been minimized.

Copy link

commented Apr 29, 2017

Thanks for the solution @tinyheero!

@passwd123

This comment has been minimized.

Copy link

commented Aug 12, 2017

Help

$ sudo gem install bundler
$ bundle install
$ bundle exec jekyll serve

bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
LoadError: cannot load such file -- /usr/share/rubygems-integration/all/specifications/bin/jekyll
/usr/local/bin/jekyll:22:in load' /usr/local/bin/jekyll:22:in <top (required)>'

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Aug 12, 2017

@passwd123 Did you install jekyll gem? What version are you using?
Please run $ jekyll -v to check

@passwd123

This comment has been minimized.

Copy link

commented Aug 12, 2017

$jekyll -v
/var/lib/gems/2.3.0/gems/jekyll-3.5.1/lib/jekyll/drops/document_drop.rb:8: warning: already initialized constant Jekyll::Drops::DocumentDrop::NESTED_OBJECT_FIELD_BLACKLIST
/usr/lib/ruby/vendor_ruby/jekyll/drops/document_drop.rb:8: warning: previous definition of NESTED_OBJECT_FIELD_BLACKLIST was here
/var/lib/gems/2.3.0/gems/jekyll-3.5.1/lib/jekyll/drops/drop.rb:8: warning: already initialized constant Jekyll::Drops::Drop::NON_CONTENT_METHODS
/usr/lib/ruby/vendor_ruby/jekyll/drops/drop.rb:8: warning: previous definition of NON_CONTENT_METHODS was here
jekyll 3.1.6

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Aug 12, 2017

Jekyll started involving Bundler in its scope from v3.2.0.
You need to have gem 'jekyll' mentioned in your Gemfile for $ bundle exec jekyll -- to work..

Open your Gemfile.lock and ensure you see jekyll 3.5.1 in it..

@passwd123

This comment has been minimized.

Copy link

commented Aug 12, 2017

my gemfile.lock

GEM
remote: https://rubygems.org/
specs:
colorator (1.1.0)
ffi (1.9.18)
jekyll (3.1.6)
colorator
jekyll-sass-converter (> 1.0)
jekyll-watch (
> 1.1)
kramdown (> 1.3)
liquid (
> 3.0)
mercenary (> 0.3.3)
rouge (
> 2.0)
safe_yaml (> 1.0)
jekyll-feed (0.7.2)
jekyll-sass-converter (1.5.0)
sass (
> 3.4)
jekyll-watch (1.5.0)
listen (> 3.0, < 3.1)
kramdown (1.14.0)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (
> 0.9, >= 0.9.4)
rb-inotify (> 0.9, >= 0.9.7)
mercenary (0.3.6)
minima (2.0.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (2.1.1)
safe_yaml (1.0.4)
sass (3.5.1)
sass-listen (
> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (> 0.9, >= 0.9.4)
rb-inotify (
> 0.9, >= 0.9.7)

PLATFORMS
ruby

DEPENDENCIES
jekyll (= 3.1.6)
jekyll-feed (> 0.6)
minima (
> 2.0)
tzinfo-data

BUNDLED WITH
1.15.3

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Aug 12, 2017

If you're willing to upgrade to the latest version of Jekyll, I recommend updating your Gemfile to following:

gem "jekyll", "~> 3.5"

Then run bundle install and you should be set..

@passwd123

This comment has been minimized.

Copy link

commented Aug 12, 2017

$gem "jekyll", "~> 3.5"
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command jekyll,

@ashmaroli

This comment has been minimized.

Copy link
Member

commented Aug 12, 2017

Add it to your Gemfile. Not into the terminal

@passwd123

This comment has been minimized.

Copy link

commented Aug 12, 2017

i add, but continue problem

@i-give-up

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2017

@passwd123 Hm your jekyll -v output looks weird. It says that it's running version 3.1.6 but it's using files from jekyll 3.5.1...

/var/lib/gems/2.3.0/gems/jekyll-3.5.1/lib/jekyll/drops/document_drop.rb:8: warning: already initialized >constant Jekyll::Drops::DocumentDrop::NESTED_OBJECT_FIELD_BLACKLIST
/usr/lib/ruby/vendor_ruby/jekyll/drops/document_drop.rb:8: warning: previous definition of >NESTED_OBJECT_FIELD_BLACKLIST was here
/var/lib/gems/2.3.0/gems/jekyll-3.5.1/lib/jekyll/drops/drop.rb:8: warning: already initialized constant >Jekyll::Drops::Drop::NON_CONTENT_METHODS
/usr/lib/ruby/vendor_ruby/jekyll/drops/drop.rb:8: warning: previous definition of >NON_CONTENT_METHODS was here
jekyll 3.1.6

I think you installed 2 different versions of jekyll: one with both apt-get install and another with gem install. Maybe you can try these

sudo apt-get remove --purge jekyll

then

sudo gem install jekyll

and see if it works (source: Stack Overflow)

@mrafsyam

This comment has been minimized.

Copy link

commented Nov 4, 2017

Had the same problem.
Adding json gem to the Gemfile and do bundle update works!
Thanks.

@jekyll jekyll locked and limited conversation to collaborators Nov 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.