开发者

Yaml parsing issue on redhat

开发者 https://www.devze.com 2023-03-10 10:03 出处:网络
On RHEL5 box for a rails app running on ruby 1.9.2, the following yaml is parsed in a way that the login_type is set to \"ldap\" even in staging en开发者_如何学JAVAvironment. Does anyone have any idea

On RHEL5 box for a rails app running on ruby 1.9.2, the following yaml is parsed in a way that the login_type is set to "ldap" even in staging en开发者_如何学JAVAvironment. Does anyone have any ideas as to why this is happening?

defaults: &defaults
  login_type: ldap

staging:
  <<: *defaults
  login_type: developer


It may have to do with this Bundler/Ruby/Psych issue -- it's already been fixed, but not in the current release of Ruby.

The reason you don't see the issue with OS X (and probably Ubuntu) is that unless you manually installed libyaml before compiling/installing Ruby, Psych does not get installed; it falls back to Syck, which works fine. (Try doing a require 'psych' on OS X and it will fail, whereas it will work fine in RHEL5)

For now, you can either force the YAML parser to use Syck instead of Psych by putting this at the end of your boot.rb (but beware -- a future version of Ruby will no longer include Syck):

YAML::ENGINE.yamler = 'syck'

Or preferably, you should just use a non-DRY YAML file (without the defaults) for the time being.

UPDATE

The newest release of Ruby that came out today (1.9.2-p290) includes a fix for this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消