RailsでWEBアプリを開発しているのですが、
rails s
でサーバーを起動すると以下のようなエラーが出ます。少し前までは問題なく、起動できたのですが、解決方法がわかりません。どなたか解決方法をご教示いただけないでしょうか。
よろしくお願いいたします。
ターミナル(エラー文)
>rails s Traceback (most recent call last): 12: from bin/rails:4:in `<main>' 11: from bin/rails:4:in `require' 10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands.rb:18:in `<top (required)>' 9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/command.rb:46:in `invoke' 8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/command/base.rb:69:in `perform' 7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:142:in `perform' 3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:142:in `tap' 2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:145:in `block in perform' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:145:in `require' C:/Users/yushi/danke/config/application.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
application.rb
rails
1require_relative "boot" 2 3require "rails/all" 4 5# Require the gems listed in Gemfile, including any gems 6# you've limited to :test, :development, or :production. 7Bundler.require(*Rails.groups) 8config.i18n.default_locale = :ja 9config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.yml").to_s] 10 11module Danke 12 class Application < Rails::Application 13 # Initialize configuration defaults for originally generated Rails version. 14 config.load_defaults 5.2 15 16 # Settings in config/environments/* take precedence over those specified here. 17 # Application configuration can go into files in config/initializers 18 # -- all .rb files in that directory are automatically loaded after loading 19 # the framework and any gems in your application. 20 config.time_zone = "Tokyo" 21 end 22end 23 24module Danke 25 class Application < Rails::Application 26 # Settings in config/environments/* take precedence over those specified here. 27 # Application configuration should go into files in config/initializers 28 # -- all .rb files in that directory are automatically loaded. 29 config.i18n.default_locale = :ja #追加 30 end 31end 32
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。