简体   繁体   English

捆绑安装导致Gemfile错误:意外的':',期望$ end gem'github-pages',组::jekyll_plugins

[英]Bundle install leads to Gemfile error: unexpected ':', expecting $end gem 'github-pages', group: :jekyll_plugins

UPDATE1. UPDATE1。

Added the line ruby '2.4.0' to my Gemfile and now the bundler complains about old ruby version: 在我的Gemfile添加了行Gemfile ruby '2.4.0' ,现在捆绑程序抱怨旧的ruby版本:

$ bundle
Your Ruby version is 1.8.7, but your Gemfile specified 2.4.0

However: 然而:

$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin12.0]

So it looks like bundler is using my old ruby version that was originally installed by the OSX, instead of the new one that I installed via homebrew . 因此,看来bundler使用的是我最初由OSX安装的旧版本的ruby,而不是我通过homebrew安装的新版本。

Is there any way to tell the bundler to use the new ruby? 有什么办法告诉bundler使用新的红宝石吗?


UPDATE. UPDATE。

I have changed line 3 of Gemfile as suggested in the answer by Sachin Singh, unfortunately that leads to further errors: 我已按照Sachin Singh的答案中的建议更改了Gemfile第3行,很不幸,这导致了进一步的错误:

...
Installing i18n (0.7.0) 
Gem::InstallError: i18n requires Ruby version >= 1.9.3.
An error occurred while installing i18n (0.7.0), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.7.0'` succeeds before bundling.

The installation gem install i18n -v '0.7.0' goes without errors but the problem persists. 安装gem install i18n -v '0.7.0'时没有错误,但问题仍然存在。


I am trying to setup Parse Docs locally but 我正在尝试在本地设置“解析文档”,但是

$ bundle install

leads to this error: 导致此错误:

Gemfile syntax error:
/Users/dmitrizaitsev/Repos/Parse-Docs/Gemfile:3: syntax error, unexpected ':', expecting $end
gem 'github-pages', group: :jekyll_plugins
                          ^

My Ruby version is 2.4: 我的Ruby版本是2.4:

$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin12.0]

Their Gemfile : 他们的Gemfile

source 'https://rubygems.org'
gem 'jekyll', '>=3.1.6'
gem 'github-pages', group: :jekyll_plugins
gem 'jekyll-redirect-from', '0.10.0'

Any idea what is wrong here? 知道这里有什么问题吗?

May be its a ruby version issue, you can try this: 可能是红宝石版本的问题,您可以尝试以下操作:

ruby '2.4.0'
source 'https://rubygems.org'
gem 'jekyll', '>=3.1.6'
gem 'github-pages', :group => 'jekyll_plugins'
gem 'jekyll-redirect-from', '0.10.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Github-Pages错误在本地运行Jekyll - Github-Pages error running Jekyll Locally 运行 bundle install jekyll github-pages 时未安装 public_suffix - public_suffix not getting installed while running bundle install jekyll github-pages Github Pages上的Jekyll设置,捆绑安装问题 - Jekyll setup on Github Pages, issues with bundle install 无法安装“ github-pages” - Cannot install 'github-pages' Jekyll自定义主题-gemspec捆绑包安装错误:意外的一元代码-,需要keyword_do - Jekyll custom theme- gemspec bundle install error: unexpected unary-, expecting keyword_do Gemfile:22: 语法错误,意外的 tIDENTIFIER,期望输入结束 - Gemfile:22: syntax error, unexpected tIDENTIFIER, expecting end-of-input “捆绑安装”忽略了Gemfile中指定的devise gem - 'bundle install' ignores the devise gem specified in the Gemfile Github 页面的“bundle exec jekyll 3.8.7 new.”错误 - Error upon `bundle exec jekyll 3.8.7 new .` for Github Pages 解析“ Gemfile”时出错:语法错误,意外的tIDENTIFIER,期望输入结束 - There was an error parsing `Gemfile`: syntax error, unexpected tIDENTIFIER, expecting end-of-input 第1行上的Gemfile语法错误:语法错误,意外的tIDENTIFIER,期望输入结束 - Gemfile syntax error on line 1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM