【问题标题】:can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)无法使用可执行 jekyll (Gem::GemNotFoundException) 找到 gem jekyll (>= 0.a)
【发布时间】:2023-02-04 09:17:21
【问题描述】:

我正在尝试按照官方website 上的说明使用 github 和 jekyll 制作我的个人网站

当我到达部分时:

jekyll new --skip-bundle

我收到了:

can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)

我尝试了几种方法,例如提到的here,我用sudo运行命令。再次运行 jekyll new --skip-bundle 后。

这是安装后的终端响应 here

Fetching bundler-2.4.5.gem
Successfully installed bundler-2.4.5
Parsing documentation for bundler-2.4.5
Installing ri documentation for bundler-2.4.5
Done installing documentation for bundler after 0 seconds
1 gem installed

这是我再次运行 jekyll new --skip-bundle 时的终端响应:

Traceback (most recent call last):
    2: from /usr/local/bin/jekyll:22:in `<main>'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:262:in `bin_path'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)

如果您能帮助我解决问题,我将不胜感激。 我使用 macOS。

更新:

我运行 bundle add jekyll 并收到:

Your RubyGems version (3.0.3) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3

找不到 Gemfile`

然后我跑gem update --system 3.2.3

Updating rubygems-update
Fetching rubygems-update-3.2.3.gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
    

下一步我运行sudo gem update --system 3.2.3,我收到了:

Updating rubygems-update
Fetching rubygems-update-3.2.3.gem
Successfully installed rubygems-update-3.2.3
Parsing documentation for rubygems-update-3.2.3
Installing ri documentation for rubygems-update-3.2.3
Installing darkfish documentation for rubygems-update-3.2.3
Done installing documentation for rubygems-update after 78 seconds
Parsing documentation for rubygems-update-3.2.3
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.2.3
ERROR:  While executing gem ... (Errno::EROFS)
    Read-only file system @ rb_sysopen - /usr/share/man/man1/bundle-platform.1

所以我仍然没有添加 jekyll ....

【问题讨论】:

    标签: ruby-on-rails ruby rubygems jekyll github-pages


    【解决方案1】:

    注意:将更新我的答案,因为我还不能评论要求澄清

    这是按照此处的说明安装后的终端响应

    您正在运行它来安装 Bundler(您可以将其视为 gem 存储)。在这里你知道对于 jekyll 错误代码,它有同样的问题(它没有找到运行 jekyll 的源代码)。要解决此问题,请安装 jekyll

    如果你想从 bundler 运行 jekyll,试试这个(推荐)Reference

    bundle add jekyll #This will add jekyll to Gemfile (gem dependencies manager)
    bundle install #This will check/install the gem from Gemfile
    bundle exec jekyll #This will run jekyll from the bundle
    

    如果不想使用bundle,可以直接安装gem

    gem install jekyll
    jekyll #this should work and have message related to jekyll
    

    【讨论】:

    • 非常感谢您的留言。我试过你的指示,但我失败了。我第二次尝试更新了我的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-12
    • 2019-05-31
    • 2019-08-17
    • 2018-01-22
    • 1970-01-01
    • 2012-03-29
    相关资源
    最近更新 更多