bundle exec jekyll serve failed
-
trace: ➜ xxx ✗ bundle exec jekyll serve --trace Dependency Error: Yikes! It looks like you don't have jemoji or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with
bundle exec, ensure that you have included the jemoji gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- nokogiri/nokogiri' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/! bundler: failed to load command: jekyll (/Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll) Traceback (most recent call last): 42: from /usr/bin/bundle:23:in<main>' 41: from /usr/bin/bundle:23:inload' 40: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:37:in<top (required)>' 39: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:inwith_friendly_errors' 38: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:49:inblock in <top (required)>' 37: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:24:instart' 36: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' 35: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:30:indispatch' 34: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' 33: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:ininvoke_command' 32: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' 31: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:494:inexec' 30: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:inrun' 29: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inkernel_load' 28: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inload' 27: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in<top (required)>' 26: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:inload' 25: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:15:in<top (required)>' 24: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:inprogram' 23: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:ingo' 22: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inexecute' 21: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:ineach' 20: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inblock in execute' 19: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:inblock (2 levels) in init_with_program' 18: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inprocess_with_graceful_fail' 17: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:ineach' 16: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inblock in process_with_graceful_fail' 15: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:inprocess' 14: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:innew' 13: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:36:ininitialize' 12: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:131:insetup' 11: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:22:inconscientious_require' 10: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:30:inrequire_gems' 9: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:inrequire_with_graceful_fail' 8: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:ineach' 7: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:60:inblock in require_with_graceful_fail' 6: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:60:inrequire' 5: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jemoji-0.12.0/lib/jemoji.rb:4:in<top (required)>' 4: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jemoji-0.12.0/lib/jemoji.rb:4:inrequire' 3: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/html-pipeline-2.14.0/lib/html/pipeline.rb:3:in<top (required)>' 2: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/html-pipeline-2.14.0/lib/html/pipeline.rb:3:inrequire' 1: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri.rb:13:in<top (required)>' /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri.rb:13:inrequire': dlopen(/Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri/2.6/nokogiri.bundle, 0x0009): could not use '/Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri/2.6/nokogiri.bundle' because it is not a compatible arch - /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri/2.6/nokogiri.bundle (LoadError) 43: from /usr/bin/bundle:23:in' 42: from /usr/bin/bundle:23:in load' 41: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:37:in<top (required)>' 40: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:inwith_friendly_errors' 39: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:49:inblock in <top (required)>' 38: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:24:instart' 37: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' 36: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:30:indispatch' 35: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' 34: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:ininvoke_command' 33: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' 32: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:494:inexec' 31: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:inrun' 30: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inkernel_load' 29: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inload' 28: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in<top (required)>' 27: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:inload' 26: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:15:in<top (required)>' 25: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:inprogram' 24: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:ingo' 23: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inexecute' 22: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:ineach' 21: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inblock in execute' 20: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:inblock (2 levels) in init_with_program' 19: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inprocess_with_graceful_fail' 18: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:ineach' 17: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inblock in process_with_graceful_fail' 16: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:inprocess' 15: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:innew' 14: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:36:ininitialize' 13: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:131:insetup' 12: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:22:inconscientious_require' 11: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:30:inrequire_gems' 10: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:inrequire_with_graceful_fail' 9: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:ineach' 8: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:60:inblock in require_with_graceful_fail' 7: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:60:inrequire' 6: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jemoji-0.12.0/lib/jemoji.rb:4:in<top (required)>' 5: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jemoji-0.12.0/lib/jemoji.rb:4:inrequire' 4: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/html-pipeline-2.14.0/lib/html/pipeline.rb:3:in<top (required)>' 3: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/html-pipeline-2.14.0/lib/html/pipeline.rb:3:inrequire' 2: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri.rb:11:in<top (required)>' 1: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri.rb:32:inrescue in <top (required)>' /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.0-arm64-darwin/lib/nokogiri.rb:32:inrequire': cannot load such file -- nokogiri/nokogiri (LoadError) 36: from /usr/bin/bundle:23:in' 35: from /usr/bin/bundle:23:in load' 34: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:37:in<top (required)>' 33: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:inwith_friendly_errors' 32: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/exe/bundle:49:inblock in <top (required)>' 31: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:24:instart' 30: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' 29: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:30:indispatch' 28: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' 27: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:ininvoke_command' 26: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' 25: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli.rb:494:inexec' 24: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:inrun' 23: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inkernel_load' 22: from /Library/Ruby/Gems/2.6.0/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:inload' 21: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in<top (required)>' 20: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/bin/jekyll:23:inload' 19: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:15:in<top (required)>' 18: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:inprogram' 17: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:ingo' 16: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inexecute' 15: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:ineach' 14: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:inblock in execute' 13: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:inblock (2 levels) in init_with_program' 12: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inprocess_with_graceful_fail' 11: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:ineach' 10: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:inblock in process_with_graceful_fail' 9: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:inprocess' 8: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:innew' 7: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:36:ininitialize' 6: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:131:insetup' 5: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:22:inconscientious_require' 4: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:30:inrequire_gems' 3: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:inrequire_with_graceful_fail' 2: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:57:ineach' 1: from /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:58:inblock in require_with_graceful_fail' /Users/xxx/blog.xxx.io/tech_articles/blog/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll/external.rb:73:inrescue in block in require_with_graceful_fail': jemoji (Jekyll::Errors::MissingDependencyException) -
OS: macOS 11.2.1
hello, have you tried with docker-compose instead?
Hi, I have the same issue, and the reason might be that my environment was set up by sudo gem install jekyll bundler. Using sudo to install ruby gem is discouraged.
I fix the problem by install ruby with brew and follow the documentation to install bundle jekyll. Everything works perfectly now.