【发布时间】:2019-12-09 06:39:04
【问题描述】:
我最近安装了适用于 Linux 的 Windows 子系统,并且正在我的 Windows 10 计算机上运行 Ubuntu 发行版。我安装了 Python、pip、Ruby 和 Jekyll,当我运行 --version 标志时,它们都被确认安装正确。
我正在尝试在我的计算机上本地运行和修改一个名为 Mediumish 的 Jekyll 主题。按照作者的说明(即运行bundle和运行jekyll serve --watch),我遇到以下错误:
Traceback (most recent call last):
5: from /usr/local/bin/jekyll:23:in `<main>'
4: from /usr/local/bin/jekyll:23:in `load'
3: from /var/lib/gems/2.5.0/gems/jekyll-3.8.6/exe/jekyll:11:in `<top (required)>'
2: from /var/lib/gems/2.5.0/gems/jekyll-3.8.6/lib/jekyll/plugin_manager.rb:48:in `require_from_bundler'
1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)
我尝试向作者的 Github 帐户提交问题,但似乎他已经停止回复(和维护)这个主题几个月了。
我发现了另一个 Stackoverflow 帖子,标题为 Ruby/Jekyll unknown error when running -watch — 这与我的经历非常相似。我已经尝试了这篇文章中推荐的解决方案,即运行jekyll build --watch 和jekyll serve --watch 命令,但也会出现同样的错误。
几个月前我能够成功运行这个主题,但是在重新格式化我的电脑,从头开始重新安装我所有的应用程序,并从作者的网站克隆一个新的主题副本后,我无法在本地提供网站服务从而阻止我查看我对博客主题所做的任何修改。
【问题讨论】:
-
也许你需要安装
bundler?一种安装方法是运行命令gem install bundler -
你可以尝试运行
bundle exec jekyll serve --watch吗? -
@Kin 我按照您的建议运行
gem install bundler并收到以下消息:Successfully installed bundler-2.0.2 Parsing documentation for bundler-2.0.2 Done installing documentation for bundler after 4 seconds 1 gem installed,但我仍然收到相同的错误。 -
@JayDorsey 运行
bundle exec jekyll serve --watch命令返回以下错误:Traceback (most recent call last): 2: from /usr/local/bin/bundle:23:in `<main>' 1: from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path' /usr/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) -
我想说这是一个已知问题。我能想到两件事:1) 运行
gem update --system2) 使用bundle --version仔细检查您的捆绑程序版本,并确保它是 2.0.2;它可能默认为旧版本。我认为系统更新会修复它,如果它是我认为的那样
标签: ruby-on-rails ruby jekyll windows-subsystem-for-linux jekyll-theme