获取yml中的值: YAML.load_file("config/email.yml") 检查文件是否存在: File.exists?('config/email.yml') 转载于:https://www.cnblogs.com/qinyan20/p/3668328.html