前提・実現したいこと
rails sでサーバーが起動しないので困っています。
発生している問題・エラーメッセージ
=> Booting Puma
=> Rails 5.1.6 application starting in development
=> Run rails server -h
for more startup options
Exiting
Traceback (most recent call last):
66: from bin/rails:3:in <main>' 65: from bin/rails:3:in
load'
64: from /home/ec2-user/environment/sample_app/bin/spring:15:in <top (required)>' 63: from /home/ec2-user/environment/sample_app/bin/spring:15:in
require'
62: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <top (required)>' 61: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in
load'
60: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/bin/spring:49:in <top (required)>' 59: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client.rb:30:in
run'
58: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call' 57: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in
call'
56: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load' 55: from /home/ec2-user/environment/sample_app/bin/rails:9:in
<top (required)>'
54: from /home/ec2-user/environment/sample_app/bin/rails:9:in require' 53: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands.rb:16:in
<top (required)>'
52: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/command.rb:44:in invoke' 51: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/command/base.rb:63:in
perform'
50: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor.rb:392:in dispatch' 49: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor/invocation.rb:127:in
invoke_command'
48: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor/command.rb:27:in run' 47: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in
perform'
46: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in tap' 45: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:135:in
block in perform'
44: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:42:in start' 43: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:80:in
log_to_stdout'
42: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/server.rb:422:in wrapped_app' 41: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:24:in
app'
40: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/server.rb:249:in app' 39: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/server.rb:349:in
build_app_and_options_from_config'
38: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/builder.rb:66:in parse_file' 37: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/builder.rb:105:in
load_file'
36: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/builder.rb:116:in new_from_string' 35: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.2/lib/rack/builder.rb:116:in
eval'
34: from config.ru:3:in block in <main>' 33: from config.ru:3:in
require_relative'
32: from /home/ec2-user/environment/sample_app/config/environment.rb:5:in <top (required)>' 31: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application.rb:353:in
initialize!'
30: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/initializable.rb:58:in run_initializers' 29: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in
tsort_each'
28: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in tsort_each' 27: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in
each_strongly_connected_component'
26: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in call' 25: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in
each'
24: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in block in each_strongly_connected_component' 23: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in
each_strongly_connected_component_from'
22: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' 21: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:in
block in tsort_each'
20: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/initializable.rb:59:in block in run_initializers' 19: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/initializable.rb:30:in
run'
18: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/initializable.rb:30:in instance_exec' 17: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/finisher.rb:128:in
block in module:Finisher'
16: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:31:in execute_if_updated' 15: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:42:in
updater'
14: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/file_update_checker.rb:81:in execute' 13: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:41:in
block in updater'
12: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:18:in reload!' 11: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in
load_paths'
10: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in each' 9: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in
block in load_paths'
8: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in load' 7: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in
load_dependency'
6: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in block in load' 5: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in
load'
4: from /home/ec2-user/environment/sample_app/config/routes.rb:1:in <top (required)>' 3: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:418:in
draw'
2: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in eval_block' 1: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in
instance_exec'
/home/ec2-user/environment/sample_app/config/routes.rb:4:in block in <top (required)>': undefined method
root' for #ActionDispatch::Routing::Mapper:0x0000000003177f20 (NoMethodError)
Did you mean? root
該当のソースコード
試したこと
undefined method 'root'と書いてあるのでroutes.rbを開いてみましたが何がエラーを起こしているのかわかりません。
補足情報(FW/ツールのバージョンなど)
Cloud9を使用しています。
1日中調べましたが解決できないので先輩方の知恵を貸していただけると幸いです。
よろしくお願いします。
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/28 02:48