Ruby 1.9.2 patchlevel 180 - libyaml 破坏 yaml 节点引用
我使用rvm升级到1.9.2-p180。在安装过程中,获取并安装了 libyaml 0.1.3。
现在,当我将database.yml放在这样的rails项目中时:
defaults: &defaults
adapter: mysql
encoding: UTF-8
username: root
password:
host: localhost
engine: InnoDB
test:
<<: *defaults
database: my_app_test
在控制台中,
YAML.load_file("config/database.yml")
结果是:
{"test" => {"apapter" => "mysql"...}}
问题是缺少“database”键。似乎没有将默认节点和测试节点合并在一起,而是只是复制默认节点。
有什么想法吗?
I used rvm upgrading to 1.9.2-p180. during the installation, libyaml 0.1.3 was fetched and installed.
Now when I have my database.yml in a rails project like this:
defaults: &defaults
adapter: mysql
encoding: UTF-8
username: root
password:
host: localhost
engine: InnoDB
test:
<<: *defaults
database: my_app_test
in console,
YAML.load_file("config/database.yml")
The result is:
{"test" => {"apapter" => "mysql"...}}
The problem is the "database" key is missing. it seems not to merge the defaults node and test node togther, rather it just copy the default node.
any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不管怎样,升级到 ruby-p290 解决了这个问题。
Anyway, upgrade to ruby-p290 solved the issue.
如果我理解正确,我无法复制它,也使用 1.9.2.180:(
向右滚动查看:
"database"=>"my_app_test"}}
)不确定这是否是如此回答,但我无法将代码放在评论中。如果我有错误的一端,我会编辑或删除......
If I understand you correctly, I can't duplicate that, also using 1.9.2.180:
(Scroll right to see:
"database"=>"my_app_test"}}
)Not sure if this is an answer as such, but I couldn't put the code in a comment. If I have the wrong end of the stick I'll edit or delete...