[英]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]
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.