ruby - 启动服务器时出现 Jekyll 错误

标签 ruby linux ubuntu jekyll octopress

我在 Ubuntu 上运行 Octopress/Jekyll。

当我执行以下命令时:

$ bundle exec rake generate preview

我收到以下错误:

/var/lib/gems/2.3.0/gems/liquid-2.5.5/lib/liquid/htmltags.rb:43: 
warning: key "index0" is duplicated and overwritten on line 46
Configuration file: /home/alex/Code/octopress/_config.yml
        Source: source
   Destination: public
  Generating... 
jekyll 2.0.0 | Error:  undefined method `extname' for 
#<Jekyll::StaticFile:0x00000003482d78>

这是我的 Gemfile:

source "https://rubygems.org"

group :development do
  gem 'rake', '~> 10.0'
  gem 'jekyll', '~> 2.0'
  gem 'octopress-hooks', '~> 2.2'
  gem 'octopress-date-format', '~> 2.0'
  gem 'jekyll-sitemap'
  gem 'rdiscount', '~> 2.0'
  gem 'RedCloth', '~> 4.2.9'
  gem 'haml', '~> 4.0'
  gem 'compass', '~> 1.0.1'
  gem 'sass-globbing', '~> 1.0.0'
  gem 'rb-fsevent', '~> 0.9'
  gem 'stringex', '~> 1.4.0'
  gem 'pygments.rb'
  gem 'maruku'
end

gem 'sinatra', '~> 1.4.2'

有人有什么想法吗? 提前致谢!

最佳答案

我已通过将 Gemfile 更新为以下内容解决了这些错误:

source "https://rubygems.org"

group :development do
  gem 'rake', '~> 10.0'
  gem 'jekyll', '~> 3.4'
  gem 'octopress-hooks', '~> 2.2'
  gem 'octopress-date-format', '~> 3.0'
  gem 'jekyll-sitemap'
  gem 'rdiscount', '~> 2.0'
  gem 'RedCloth', '~> 4.2.9'
  gem 'haml', '~> 4.0'
  gem 'compass', '~> 1.0.1'
  gem 'sass-globbing', '~> 1.0.0'
  gem 'rb-fsevent', '~> 0.9'
  gem 'stringex', '~> 1.4.0'
  gem 'pygments.rb', '~> 0.6.3'
  gem 'jekyll-paginate'
end

gem 'sinatra', '~> 1.4.2'

请注意,我的 pygments.rb gem 似乎无法正常工作 - 它不会根据语言(即 Ruby)突出显示代码语法:它只是更改字体系列并将其保持为淡灰色(而不是以 ruby 颜色突出显示)。

但这是另一个问题。 目前,最初的错误 - 至少 - 已得到解决。

关于ruby - 启动服务器时出现 Jekyll 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42215137/

相关文章:

python - 在作业文件中加载 virtualenv 以在 linux 集群上运行

c - 将子进程的标准输入和标准输出重定向到管道

linux 将 dwdiff 结果的最后一行重定向到文件

ruby-on-rails - 带有 cron 的可安装引擎(每当 gem 时)

ruby-on-rails - Rails default_scope 被应用于更新

c++ - 在 Ubuntu 11.10 下链接 boost_thread 失败

带有 nginx uwsgi 错误网关 502 的 django

C++ Plist 解析器

ruby-on-rails - 使用关联模型的参数创建 Rails 模型?

ruby-on-rails - 尝试使用 Rails 和 PostgreSQL 生成模型时,命令挂起且没有错误