Siv*_*mar 9 ruby yaml rails-3-upgrade
我目前正在将我的应用程序从rails 2.3升级到3.0和ruby 1.9.3.在进行所需的更改并尝试访问我的应用程序的主页后,我收到以下错误.
Psych::SyntaxError ((/apps/myapp/config/locales/en.yml): did not find expected node content while parsing a flow node at line 73 column 14):
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:203:in `parse'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:151:in `parse'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:127:in `load'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:297:in `block in load_file'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:297:in `open'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:297:in `load_file'
Run Code Online (Sandbox Code Playgroud)
完整的堆栈跟踪可以在http://pastie.org/5478123找到
en.yml的第73行包含
order: [:year, :month, :day]
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题.目前myapp运行在Rails 2.3.14和ruby 1.8.7上
mat*_*att 16
Ruby 1.9.3使用Psych作为其Yaml解析器,1.8.7使用旧的和过时的Syck.您所看到的问题是LibYaml中已知的问题,即Psych构建的库,并且由于在流上下文中允许冒号时出现一些模糊性.
关于这个有一个Ruby错误.
解决方案是更改您的Yaml以使用块上下文:
order:
- :year
- :month
- :day
Run Code Online (Sandbox Code Playgroud)
Rails已经更改了生成此Yaml的模板以避免此错误.
| 归档时间: |
|
| 查看次数: |
5346 次 |
| 最近记录: |