Mike Simmons
Mike Simmons

Reputation: 328

Heroku pukes on en.yaml

I have deployed an app to Heroku. The app works okay in dev, and tests pass. The deployment works and webserver is running. However the following line from the en.yml file is causing internal server error.

ActionView::Template::Error (syntax error on line 14, col 8: `        current_practice_telephone:           "Telephone"'):

My full en.yml file

en:
  activerecord:
    attributes:
      user:
        password_digest: "Password"
    credential:
        current_practice_address_line1:     "Address"
        current_practice_address_city:      "City"
        current_practice_address_state:     "State"
        current_practice_address_country:   "Country"
        current_practice_address_zip_code:  "Zip Code"
        current_practice_telephone:         "Telephone"
        NPI_number:                         "Your NPI Number"
        license_number:                     "Your State License Number"
        state_license_website_link:         "Can you provide a link to your state license information? (Optional)"
        current_practice_name:              "Practice Name"
        current_practice_title:             "Your Title"
        current_practice_fellowship:        "Name of your Fellowship"
        current_practice_residency:         "Name of your Residency"
        current_practice_subspecialty:      "Name of your subspecialty"

I'm really confused why heroku server would puke here. Any ideas?

UPDATE: I fixed the missing quote but heroku still will not process the YAML file. After the lastest update:

local console

 YAML.load(File.open('config/locales/en.yml'))
 => {"en"=>{"activerecord"=>{"attributes"=>{"user"=>{"password_digest"=>"Password"}}, "credential"=>{"current_practice_address_line1"=>"Address", "current_practice_address_city"=>"City", "current_practice_address_state"=>"State", "current_practice_address_country"=>"Country", "current_practice_address_zip_code"=>"Zip Code", "current_practice_telephone"=>"Telephone", "NPI_number"=>"Your NPI Number", "license_number"=>"Your State License Number", "state_license_website_link"=>"Can you provide a link to your state license information? (Optional)", "current_practice_name"=>"Practice Name", "current_practice_title"=>"Your Title", "current_practice_fellowship"=>"Name of your Fellowship", "current_practice_residency"=>"Name of your Residency", "current_practice_subspecialty"=>"Name of your subspecialty"}}}} 

heroku console

irb(main):001:0> YAML.load(File.open('config/locales/en.yml'))
ArgumentError: syntax error on line 11, col 8: `        current_practice_telephone:         "Telephone"'
    from /usr/local/lib/ruby/1.9.1/syck.rb:135:in `load'
    from /usr/local/lib/ruby/1.9.1/syck.rb:135:in `load'
    from (irb):1
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
irb(main):002:0> 

Upvotes: 0

Views: 189

Answers (2)

RadBrad
RadBrad

Reputation: 7304

You are missing a quote after "Zip Code

But in general, when you see this error it's because your editor has replaced spaces with tab characters. Yml is dependent on spaces for indentation.

Upvotes: 2

doesterr
doesterr

Reputation: 3965

You probably have a invisible character on the affected line that causes the problems. Either configure your editor to show invisible characters, or simple delete the line, and type it again.

Upvotes: 1

Related Questions