0

我是 Rails 新手,正在学习 Hartl Rails 教程并使用 Railsinstaller 安装

C:\Sites\sample_app>捆绑更新

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/dsl.rb:7:ininstance_eval': C:/Sites/sample_app/Gemfile:43: syntax error, unexp ected $end, expecting keyword_end (SyntaxError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler/dsl.rb:7:in评估'来自 C:/RailsInstaller/Ruby1.9.3/ lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler/definition.rb:17:in build' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler.rb:138:indefinition' 来自 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1 /gems/bundler-1.0.22 /lib/bundler/cli.rb:262:in update' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler/vendor/thor/task.rb:22:inrun' 从 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 / lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler/vendor/thor.rb:263:indispatch' 来自 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /lib/bundler/vendor /thor/base.rb:386:in start' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22 /bin/bundle:13:in'来自 C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in load' from C:/RailsInstaller/Ruby1.9.3/bin/bundle:19:in'

这是我的宝石文件。它看起来是正确的,但我只是不知道捆绑安装出错了。

Source 'https://rubygems.org'

gem 'rails', '3.2.12'

group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
gem 'jquery-rails', '2.0.2'
gem 'rb-readline'

group :test do
gem 'capybara', '1.1.2'
end

group :production do
gem 'pg', '0.12.2'
end
4

2 回答 2

0

test, development您还没有关闭该组assets。你需要像这样关闭它们:

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
  gem 'jquery-rails', '2.0.2'
  gem 'rb-readline'
end

PS:尽量保持你的代码缩进。只需浏览文件,就可以帮助找出未关闭的标签。:)

于 2013-02-21T05:48:22.777 回答
0

加载 sqlite3 gem 的开发和测试组永远不会结束。应该是这样的:

group :development, :test do
    gem 'sqlite3', '1.3.5'
    gem 'rspec-rails', '2.11.0'
end
于 2013-02-20T12:53:26.890 回答