質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
86.12%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

受付中

Railsチュートリアル三章で rails server実行後エラー

toko0426
toko0426

総合スコア10

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0回答

0リアクション

0クリップ

102閲覧

投稿2019/04/02 08:11

前提・実現したいこと

Railsチュートリアル三章で
rails server実行後エラーメッセージが発生しました。
rails consoleを実行してもエラーが起きます

発生している問題・エラーメッセージ

=> Booting Puma => Rails 5.1.6 application starting in development => Run `rails server -h` for more startup options Exiting /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:327:in `check_part': Missing :controller key on routes definition, please check your routes. (ArgumentError) from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:307:in `check_controller_and_action' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:252:in `normalize_options!' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:116:in `initialize' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:69:in `new' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:69:in `build' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1920:in `add_route' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1892:in `decomposed_match' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1856:in `block in map_match' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1850:in `each' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1850:in `map_match' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:1598:in `match' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:731:in `map_method' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:692:in `get' from /Users/idaryuunosuke/Documents/environment/sample_app/config/routes.rb:2:in `block in <top (required)>' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in `instance_exec' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in `eval_block' from /Library/Ruby/Gems/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:418:in `draw' from /Users/idaryuunosuke/Documents/environment/sample_app/config/routes.rb:1:in `<top (required)>' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in `block in load_paths' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in `each' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in `load_paths' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:18:in `reload!' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:41:in `block in updater' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.1.6/lib/active_support/file_update_checker.rb:81:in `execute' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:42:in `updater' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:347:in `each' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:347:in `call' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!' from /Users/idaryuunosuke/Documents/environment/sample_app/config/environment.rb:5:in `<top (required)>' from config.ru:3:in `require_relative' from config.ru:3:in `block in <main>' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize' from config.ru:in `new' from config.ru:in `<main>' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:219:in `app' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:24:in `app' from /Library/Ruby/Gems/2.3.0/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:80:in `log_to_stdout' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:42:in `start' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:135:in `block in perform' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `tap' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke' from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' from /Users/idaryuunosuke/Documents/environment/sample_app/bin/rails:9:in `require' from /Users/idaryuunosuke/Documents/environment/sample_app/bin/rails:9:in `<top (required)>' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load' from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require' from /Users/idaryuunosuke/Documents/environment/sample_app/bin/spring:15:in `<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in `<main>'`` ### 試したこと rails serverとrails consoleで検索したが対処方がわからなかった。 ここに問題に対して試したことを記載してください。 ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。

以下のような質問にはリアクションをつけましょう

  • 質問内容が明確
  • 自分も答えを知りたい
  • 質問者以外のユーザにも役立つ

リアクションが多い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。

気になる質問をクリップする

クリップした質問は、後からいつでもマイページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

下記のような質問は推奨されていません。

  • 間違っている
  • 質問になっていない投稿
  • スパムや攻撃的な表現を用いた投稿

適切な質問に修正を依頼しましょう。

maisumakun

2019/04/03 01:25

「please check your routes.」と出ていますが、ルーティングはどの様になっていますでしょうか。
toko0426

2019/04/04 15:46

ルーティング直したらいけました! エラー文よく見たらわかるものですね。 今度からもっとよく見るよにします。 ありがとうございましたm(_ _)m

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
86.12%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問

同じタグがついた質問を見る

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。