1

由于Sprockets 中的一个问题在 Ruby 2.0 中失败,我需要将我的 Rails 版本更新到最新版本。结果,我的 Gemfile 看起来像这样:

gem 'rails', git: 'git://github.com/rails/rails.git', branch: "3-2-stable"

然后导致如下所示的堆栈跟踪。Rails edge 也出现了同样的问题,尽管他们正在针对 Ruby 2.0 运行他们的测试套件,因此它必须兼容。

所以我猜可能存在 Rails 或 Ruby 构建的依赖库与 Ruby 2.0-preview1 不兼容

> bundle
Updating git://github.com/rails/rails.git
Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 
.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 8 column 35 (Psych::SyntaxError)
  from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
  from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:153:in `parse'
  from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:129:in `load'
  from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:491:in `from_yaml'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler.rb:294:in `block in load_gemspec_uncached'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler.rb:291:in `chdir'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler.rb:291:in `load_gemspec_uncached'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler.rb:282:in `load_gemspec'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:411:in `block in load_spec_files'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:410:in `each'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:410:in `load_spec_files'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:799:in `load_spec_files'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:381:in `local_specs'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/source.rb:774:in `specs'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:491:in `block in converge_locked_specs'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:480:in `each'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:480:in `converge_locked_specs'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:166:in `resolve'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/bin/bundle:14:in `block in <top (required)>'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
  from .rvm/gems/ruby-2.0.0-preview1@global/gems/bundler-1.2.1/bin/bundle:14:in `<top (required)>'
  from .rvm/gems/ruby-2.0.0-preview1@global/bin/bundle:19:in `load'
  from .rvm/gems/ruby-2.0.0-preview1@global/bin/bundle:19:in `<main>'
  from .rvm/gems/ruby-2.0.0-preview1@album_releases/bin/ruby_noexec_wrapper:14:in `eval'
  from .rvm/gems/ruby-2.0.0-preview1@album_releases/bin/ruby_noexec_wrapper:14:in `<main>'
4

2 回答 2

1

这是 Bundler 中的一个错误,如下所述:https ://github.com/rails/rails/issues/8136

它已经被修复了。

于 2012-11-19T23:37:14.537 回答
0

我有这个问题。这是由于在gemspec(在我的情况下是Prawn)中的heredoc中看到像“this:”这样的代码并认为它​​是一个散列引起的。我相信这是 2.0.0-preview1 的回归,因为我之前有过 ruby​​-head,但没有遇到这个问题。

于 2012-11-12T19:46:14.160 回答