简体   繁体   English

尝试运行捆绑安装GEMFILES的语法错误

[英]Syntax Error Trying To Run A Bundle Install GEMFILES

I'm following through a online course at https://onemonth.com/ , I was asked to add the bootstrap-sass gem to my Gemfile and then run bundle install . 我正在通过https://onemonth.com/上的在线课程进行学习,要求我将bootstrap-sass gem添加到我的Gemfile中,然后运行bundle install

Below is my Gemfile 以下是我的Gemfile

source 'https://rubygems.org'

gem 'rails', '4.1.1'

gem 'sqlite3'


gem 'sass-rails', '~> 4.0.3'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.0.0'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 2.0'

gem 'bootstrap-sass',

gem 'sdoc', '~> 0.4.0',          group: :doc

gem 'spring',        group: :development

I ran bundle install and a Error message appeared: 我运行了软件包安装程序,并出现错误消息:

Gemfile syntax error on line 11: syntax error, unexpected tSTRING_BEG, expecting
keyword_do or '{' or '('
gem 'sdoc', '~> 0.4.0',          group: :doc
     ^
on line 11: syntax error, unexpected ',', expecting end-of-input
gem 'sdoc', '~> 0.4.0',          group: :doc

I tried deleting the ',' after the gem 'sdoc', '~> 0.4.0', but nothing changed still giving me the same Error message... 我尝试删除gem 'sdoc', '~> 0.4.0', ','之后的gem 'sdoc', '~> 0.4.0',但没有任何变化仍然给我同样的错误消息...

Any idea of what's going wrong? 有什么问题的想法吗?

You have a comma at the end of the line. 该行的末尾有一个逗号。 gem 'bootstrap-sass', should be gem 'bootstrap-sass' . gem 'bootstrap-sass',应该是gem 'bootstrap-sass'

gem 'sdoc', '~> 0.4.0',          group: :doc

change to : 改成 :

group :doc do
  gem 'sdoc', '~> 0.4.0'
end

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM