本文介绍了Jekyll自定义主题 - gemspec软件包安装错误:意外的一元 - 期待keyword_do的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 # coding: utf-8Gem::Specification.new do |spec| spec.name = "myJekyllTheme" spec.version = "1.0.1" spec.authors = ["Mai Walters"] spec.email = ["[email protected]"] spec.summary = %q{A simple theme for my CMS class.} spec.homepage = "https://www.github.uconn.edu/mvw13001/myJekyllTheme" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.add_runtime_dependency "jekyll", "~> 3.4" spec.add_development_dependency "bundler", "~> 1.12" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "jekyll-polyglot", ">= 1.2.4" spec.add_development_dependency "jekyll-seo-tag", ">= 2.1.0" spec.add_development_dependency "jekyll-paginate", ">= 1.1.0" spec.add_development_dependency "jekyll-feed", "~> 0.6"end我正在使用这个代码尝试创建一个jekyll主题,并且我设置了我的gemspec文件,但是每次运行bundle install时,都会收到此错误消息: I am using this code to try to create a jekyll theme and I am setting up my gemspec file but every time I run bundle install, I get this error: C:\Users\M\myJekyllTheme>bundle install[!] There was an error parsing `Gemfile`: syntax error, unexpected unary-, expecting keyword_do or '{' or '(' - ....files = git ls-files -z.split("\x0").select { |f| f...... ^. Bundler cannot continue. # from C:/Users/M/myJekyllTheme/Gemfile:15 # ------------------------------------------- # spec.add_development_dependency "bundler", "~> 1.12" > end # source "https://rubygems.org"# -------------------------------------------有人知道为什么会这样吗?Does anyone know why this would be?推荐答案尝试更改此项: Try changing this:spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } to this (one line):spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 这篇关于Jekyll自定义主题 - gemspec软件包安装错误:意外的一元 - 期待keyword_do的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 01:52