nuc093
V2EX  ›  macOS

OSX jekyll install 后 jekyll 启动报如下错误

  •  
  •   nuc093 · Dec 12, 2016 · 4336 views
    This topic created in 3613 days ago, the information mentioned may be changed or developed.

    qk:b qk$ jekyll server /usr/local/Cellar/ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bundler (LoadError) from /usr/local/Cellar/ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/lib/ruby/gems/2.3.0/gems/jekyll-3.3.1/lib/jekyll/plugin_manager.rb:34:in require_from_bundler' from /usr/local/lib/ruby/gems/2.3.0/gems/jekyll-3.3.1/exe/jekyll:9:in<top (required)>' from /usr/local/bin/jekyll:22:in load' from /usr/local/bin/jekyll:22:in<main>'

    13 replies  •  2016-12-15 09:48:50 +08:00
    SoloCompany
    SoloCompany
    Dec 12, 2016
    1
    如果你希望使用的是 github-pages 的话
    应该用 gem install github-pages 来安装 jekyll
    marenight
    marenight
    Dec 12, 2016 via iPhone
    2
    有可能是 ruby 版本问题
    nuc093
    nuc093
    OP
    Dec 12, 2016
    3
    感谢楼上两位帮助,我搜了一下相关的问题及一些解决方法是:

    https://github.com/jekyll/jekyll/issues/3984


    Proposed Checklist for Mac OS X 10.11 El Capitan

    Install the Xcode command line utilities xcode-select --install
    Install Homebrew (instructions at http://brew.sh)
    Modify $PATH to use Homebrew export PATH=/usr/local/bin:$PATH
    Modify $PATH for GUI apps launchctl setenv PATH "/usr/local/bin:$PATH"
    Install the latest Ruby brew install ruby
    Install the latest Jekyll gem install jekyll


    http://stackoverflow.com/questions/31567029/how-can-i-install-jekyll-on-osx-10-11

    Jekyll & Mac OS X 10.11

    http://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
    nuc093
    nuc093
    OP
    Dec 12, 2016
    4
    不过我照我找到的方法做了好几篇还是报同样的错
    nuc093
    nuc093
    OP
    Dec 12, 2016
    5
    qk:b qk$ echo $PATH
    /usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/qk/.rvm/bin
    qk:b qk$ ruby --version
    ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
    046569
    046569
    Dec 12, 2016
    6
    LZ 贴下下面两条命令的结果
    `which bundle
    gem list|grep bundler`
    nuc093
    nuc093
    OP
    Dec 13, 2016
    7
    @046569
    ➜ ~ which bundle
    bundle not found
    ➜ ~ gem list|grep bundler
    046569
    046569
    Dec 13, 2016
    8
    @nuc093
    你忘记安装包管理了.
    gem install bundler
    然后再试.
    nuc093
    nuc093
    OP
    Dec 13, 2016
    9
    @046569

    ➜ b git:(gh-pages) ✗ which bundle
    /usr/local/bin/bundle
    ➜ b git:(gh-pages) ✗ jekyll --server
    /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/definition.rb:179:in `rescue in specs': Your bundle is locked to i18n (0.7.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of i18n (0.7.0) has removed it. You'll need to update your bundle to a different version of i18n (0.7.0) that hasn't been removed in order to install. (Bundler::GemNotFound)
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/definition.rb:173:in `specs'
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/definition.rb:233:in `specs_for'
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/definition.rb:222:in `requested_specs'
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:118:in `block in definition_method'
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:19:in `setup'
    from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:99:in `setup'
    from /usr/local/lib/ruby/gems/2.3.0/gems/jekyll-3.3.1/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
    from /usr/local/lib/ruby/gems/2.3.0/gems/jekyll-3.3.1/exe/jekyll:9:in `<top (required)>'
    from /usr/local/bin/jekyll:22:in `load'
    from /usr/local/bin/jekyll:22:in `<main>'

    ### 可能还是版本问题
    046569
    046569
    Dec 14, 2016
    10
    猜测你下载了一个老项目,或者别人的模板?
    检查:
    1. 原项目中标明的 ruby 版本,并且执行 bundle install .
    2. Gemfile 的相关文件中的内容是否正确,比如源?
    3. 如果都没问题,尝试升级下 Gemfile ?
    nuc093
    nuc093
    OP
    Dec 14, 2016
    11
    @046569
    嗯 我先是 brew install ruby 的,后来 rbevn install 某版本。
    nuc093
    nuc093
    OP
    Dec 15, 2016
    12
    @046569
    是别人的模板。正如你所定位的问题,敲以下两个命令

    ➜ b git:(gh-pages) ✗ bundle update

    ➜ b git:(gh-pages) ✗ bundle exec jekyll serve

    http://idratherbewriting.com/documentation-theme-jekyll/

    按照此文章的第四点进行操作

    ### 4. Option 2: Build the Theme (with the github-pages gem)

    If you are in fact publishing on Github Pages, leave the Gemfile and Gemfile.lock files in the theme.The Gemfile tells Jekyll to use the github-pages gem. However, note that you cannot use the normal jekyll serve command with this gem due to dependency conflicts between the latest version of Jekyll and Github Pages (which are noted briefly here).

    You need Bundler to resolve these dependency conflicts. Use Bundler to install all the needed Ruby gems:

    bundle update
    Then always use this command to build Jekyll:

    bundle exec jekyll serve
    046569
    046569
    Dec 15, 2016
    13
    @nuc093
    解决就好,写写博客还是挺好的.我一直在写.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3017 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 12:00 · PVG 20:00 · LAX 04:00 · JFK 07:00
    ♥ Do have faith in what you're doing.