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

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

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

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

Q&A

解決済

1回答

897閲覧

rails s コマンドでエラー

Kon0829

総合スコア11

Ruby on Rails

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

0グッド

0クリップ

投稿2019/06/03 08:05

rails s

を実行するとエラーメッセージが出て実行できない状態です。
JQyeryの書き込みはしましたが、それ以外は何もしていません。
追加したコードを削除しても、立ち上げることはできませんでした。

初心者なためアドバイスいただけると助かります。
よろしくお願いします。

発生している問題・エラーメッセージ(文字数制限のため途中まで)

Kon0829@PC:/mnt/c/serwer$ bundle exec rails s => Booting Puma => Rails 5.2.3 application starting in development => Run `rails server -h` for more startup options Exiting Traceback (most recent call last): 95: from bin/rails:4:in `<main>' 94: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' 93: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' 92: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' 91: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' 90: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' 89: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' 88: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' 87: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' 86: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>' 85: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke' 84: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform' 83: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch' 82: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command' 81: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run' 80: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform' 79: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap' 78: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in `block in perform' 77: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:in `start' 76: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout' 75: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:354:in `wrapped_app' 74: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in `app' 73: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:219:in `app' 72: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/server.rb:319:in `build_app_and_options_from_config' 71: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in `parse_file' 70: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `new_from_string' 69: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `eval' 68: from config.ru:in `<main>' 67: from config.ru:in `new' 66: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize' 65: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval' 64: from config.ru:3:in `block in <main>' 63: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative' 62: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' 61: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' 60: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' 59: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' 58: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' 57: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' 56: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' 55: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' 54: from /mnt/c/serwer/config/environment.rb:5:in `<main>' 53: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!' 52: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers' 51: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each' 50: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each' 49: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component' 48: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `call' 47: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each' 46: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component' 45: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from' 44: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 43: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each' 42: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers' 41: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run' 40: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec' 39: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>' 38: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:10:in `execute' 37: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/file_update_checker.rb:83:in `execute' 36: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:30:in `block in updater' 35: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:19:in `reload!' 34: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:34:in `clear!' 33: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:34:in `each' 32: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application/routes_reloader.rb:36:in `block in clear!' 31: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:449:in `clear!' 30: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:449:in `each' 29: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:449:in `block in clear!' 28: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:432:in `eval_block' 27: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec' 26: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/engine.rb:48:in `block (3 levels) in <class:Engine>' (erb):9:in `eval': undefined local variable or method `redis' for main:Object (NameError)

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

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

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

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

asm

2019/06/03 08:10

問題特定に必要なエラーメッセージは そこより後`1: from`となってるあたりなのですが・・・ありませんか?
Kon0829

2019/06/03 08:12

このサイトの使い方があまりわかっておらずすみません! ※文字数で入りませんでした。 以降のエラーは次の通りです。 25: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable.rb:46:in `server' 24: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' 23: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' 22: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' 21: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' 20: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' 19: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' 18: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' 17: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' 16: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb:5:in `<main>' 15: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb:6:in `<module:ActionCable>' 14: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/server/base.rb:87:in `<module:Server>' 13: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks' 12: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each' 11: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks' 10: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook' 9: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control' 8: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook' 7: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval' 6: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/engine.rb:33:in `block (2 levels) in <class:Engine>' 5: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:235:in `config_for' 4: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/erb.rb:876:in `result' 3: from /home/Kon0829/.rbenv/versions/2.5.1/lib/ruby/2.5.0/erb.rb:876:in `eval' 2: from (erb):9:in `<main>' 1: from (erb):9:in `eval'
guest

回答1

0

ベストアンサー

おそらく、config/cable.ymlの記述が何か間違っています。
(configディレクトリにcableから始まるファイル名が他にあるなら、そのせいかも)

投稿2019/06/03 08:49

編集2019/06/03 08:50
asm

総合スコア15147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Kon0829

2019/06/03 09:06 編集

ありがとうございます。 昨日までは動いていたのが何かのタイミングで変更になったか、もとからおかしかったか、ですかね。 共同作業者もいるのでそちらにも確認してみます。 一度、ご指摘いただいたファイルの中身確認してみます!
Kon0829

2019/06/03 08:56

config ディレクトリには cable.yml しかありません! ちなみにどのエラー文から推測されたのでしょうか。 後学のために教えていただけると助かります。
Kon0829

2019/06/03 09:50

ご指摘の通り、config/cable.yml に記述間違いがあり、そちらを修正することで無事に立ち上げることができました! 迅速な回答ありがとうございました。
asm

2019/06/03 14:01

注目すべきは 6: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/actioncable-5.2.3/lib/action_cable/engine.rb:33:in `block (2 levels) in <class:Engine>' 5: from /mnt/c/serwer/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:235:in `config_for' この2行です。 それぞれを調べると https://github.com/rails/rails/blob/v5.2.3/actioncable/lib/action_cable/engine.rb#L33 https://github.com/rails/rails/blob/v5.2.3/railties/lib/rails/application.rb#L235 なので config_path = Pathname.new(app.config.paths["config/cable"].first) がerbとして解釈した際にエラーが出てる事がわかります。
Kon0829

2019/06/07 08:44

確認が遅くなり大変失礼いたしました。 ポイント教えていただきありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問