0

Herokuにアプリをデプロイしました。アプリは開発で問題なく動作し、テストに合格します。デプロイメントが機能し、Webサーバーが実行されています。ただし、en.ymlファイルの次の行が内部サーバーエラーを引き起こしています。

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

私の完全な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サーバーがここで吐くのか私は本当に混乱しています。何か案は?

更新:欠落している引用符を修正しましたが、herokuはまだYAMLファイルを処理しません。最新の更新後:

ローカルコンソール

 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コンソール

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> 
4

2 に答える 2

2

「郵便番号」の後に引用符がありません

ただし、一般に、このエラーが表示されるのは、エディターがスペースをタブ文字に置き換えたためです。Ymlはインデントのためにスペースに依存しています。

于 2012-11-17T21:04:52.060 に答える
1

影響を受けた行に、問題の原因となる非表示の文字が含まれている可能性があります。非表示の文字を表示するようにエディターを構成するか、行を削除してもう一度入力してください。

于 2012-11-18T02:16:39.783 に答える