###前提・実現したいこと
現在Railsの勉強中で、Deviseの日本語化に挑戦しています。
ブログ等を見ながらやっています。
###発生している問題・エラーメッセージ
サーバーを立ち上げようとすると、エラーが発生します
多くのブログには、 config.i18n.default_locale = :ja
これを、config/application.rbに追加しろとあるのですが、
これを書き込むと、ターミナルでエラーが発生します。
エラーメッセージ rails s /Users/kanta/shout/config/application.rb:7:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
###該当のソースコード
require_relative 'boot' require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) config.i18n.default_locale = :ja module Shout class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. end end
###試したこと
書き込む場所が問題だとおもい、色位rなところに書き込んでみました。
config/application.rb
のいろいろな行に追加してみました。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/12/10 10:23