Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 编辑Gemfile、运行bundle安装或bundle更新后出现“Gemfile语法错误”_Ruby On Rails_Ruby_Bundler - Fatal编程技术网

Ruby on rails 编辑Gemfile、运行bundle安装或bundle更新后出现“Gemfile语法错误”

Ruby on rails 编辑Gemfile、运行bundle安装或bundle更新后出现“Gemfile语法错误”,ruby-on-rails,ruby,bundler,Ruby On Rails,Ruby,Bundler,我是一个Rails新手,尝试跟随向导。 我正在使用: 创业板2.0.3 捆扎机1.3.5 轨道3.2.13 ruby 2.0.0-p195 在编辑GEM文件后执行捆绑包更新或捆绑包安装时,出现以下错误: roberts-imac-6:first_app bobbaird001$ bundle update **Gemfile syntax error:** roberts-imac-6:first_app bobbaird001$ bundle install **Gemfile syntax

我是一个Rails新手,尝试跟随向导。 我正在使用:

创业板2.0.3 捆扎机1.3.5 轨道3.2.13 ruby 2.0.0-p195 在编辑GEM文件后执行捆绑包更新或捆绑包安装时,出现以下错误:

roberts-imac-6:first_app bobbaird001$ bundle update
**Gemfile syntax error:**
roberts-imac-6:first_app bobbaird001$ bundle install
**Gemfile syntax error:**
这是我删除了注释掉的行的文件

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'sqlite3', '1.3.5'
end
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.2'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  gem 'uglifier', '>= 1.2.3'cdacd
  end
  gem 'jquery-rails', '2.0.2'
  end
你有语法错误 替换这个

gem 'uglifier', '>= 1.2.3'cdacd 
对此

gem 'uglifier', '>= 1.2.3' 
你有语法错误 替换这个

gem 'uglifier', '>= 1.2.3'cdacd 
对此

gem 'uglifier', '>= 1.2.3' 

除了@Ruba Ruba提到的额外字符外,根据您问题中的GEM文件,您还有一些额外的结束语句-您确实只需要在uglifier之后的一行中使用。

除了@Ruba Ruba提到的额外字符外,根据您问题中的Gemfile,您有几个额外的end语句-您实际上只需要uglifier后面一行上的语句。

删除sqlite和jquery rails下面的end,删除uglifier末尾的cdacd,并按如下方式更正缩进:

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'sqlite3', '1.3.5'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.2'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  gem 'uglifier', '>= 1.2.3'
end

gem 'jquery-rails', '2.0.2'
只有do块内的宝石需要缩进

希望这有助于澄清问题

删除sqlite和jquery rails下面的末端,删除uglifier末端的cdacd,并按如下方式更正缩进:

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'sqlite3', '1.3.5'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.2'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  gem 'uglifier', '>= 1.2.3'
end

gem 'jquery-rails', '2.0.2'
只有do块内的宝石需要缩进


希望这有助于澄清问题

我认为jQueryRails应该位于资产组内部。更新:或者可能不是:这似乎是合乎逻辑的。但是生成的GEM文件在资产组之外。无论如何,:assets组将从Rails 4中删除。我认为jQueryRails应该位于assets组中。更新:或者可能不是:这似乎是合乎逻辑的。但是生成的GEM文件在资产组之外。无论如何,将从Rails 4中删除:资产组。