私がする時
excel_mapping = YAML.load_file("#{Rails.root}/config/FdfToExcelMapping.yml")
開発環境では、結果は文字列のハッシュです
heroku にデプロイされたときの本番環境excel_mapping
では、文字列に評価されます。
私は何が欠けていますか?
$heroku run console
config = YAML.load_file("#{Rails.root}/config/FdfToExcelMapping.yml")
=> "LastName:\t\tA FirstName:\t\tB County:\t\t\tC Company:\t\tD MainPhone:\t\tE Code:\t\t\tF Source:\t\t\tG Plan:\t\t\tH Type:\t\t\tI CurrentInsurance:\tJ TypeOfCoverage:\t\tK DateAdded:\t\tM Address1:\t\tO Address2:\t\tP City:\t\t\tQ State:\t\t\tR Zip:\t\t\tS County1:\t\tT Email:\t\t\tU DOB:\t\t\tV SSN:\t\t\tW Eff2Exp:\t\tX Y:\t\t\tY Business:\t\tZ HireDate:\t\tAA Effective:\t\tAB PP:\t\t\tAC CName1:\t\t\tAD CDOB1:\t\t\tAE CSSN1:\t\t\tAF CPP1:\t\t\tAG CName2:\t\t\tAH CDOB2:\t\t\tAI CSSN2:\t\t\tAJ CPP2:\t\t\tAK Spouse:\t\t\tAL SpouseDOB:\t\tAM SpouseSSN:\t\tAN SpousePP:\t\tAO CName3:\t\t\tAP CDOB3:\t\t\tAQ CSSN3:\t\t\tAR CPP3:\t\t\tAS CName4:\t\t\tAT CDOB4:\t\t\tAU CSSN4:\t\t\tAV CPP4:\t\t\tAW"
$rails console
config = YAML.load_file("#{Rails.root}/config/FdfToExcelMapping.yml")
=> {"LastName"=>"A", "FirstName"=>"B", "County"=>"C", "Company"=>"D", "MainPhone"=>"E", "Code"=>"F", "Source"=>"G", "Plan"=>"H", "Type"=>"I", "CurrentInsurance"=>"J", "TypeOfCoverage"=>"K", "DateAdded"=>"M", "Address1"=>"O", "Address2"=>"P", "City"=>"Q", "State"=>"R", "Zip"=>"S", "County1"=>"T", "Email"=>"U", "DOB"=>"V", "SSN"=>"W", "Eff2Exp"=>"X", "Y"=>"Y", "Business"=>"Z", "HireDate"=>"AA", "Effective"=>"AB", "PP"=>"AC", "CName1"=>"AD", "CDOB1"=>"AE", "CSSN1"=>"AF", "CPP1"=>"AG", "CName2"=>"AH", "CDOB2"=>"AI", "CSSN2"=>"AJ", "CPP2"=>"AK", "Spouse"=>"AL", "SpouseDOB"=>"AM", "SpouseSSN"=>"AN", "SpousePP"=>"AO", "CName3"=>"AP", "CDOB3"=>"AQ", "CSSN3"=>"AR", "CPP3"=>"AS", "CName4"=>"AT", "CDOB4"=>"AU", "CSSN4"=>"AV", "CPP4"=>"AW"}