質問編集履歴

2

ターミナル上でのエラー内容を追記

2021/12/18 09:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -372,6 +372,106 @@
372
372
 
373
373
 
374
374
 
375
+ # エラー内容
376
+
377
+ ```
378
+
379
+ (0.4ms) SELECT sqlite_version(*)
380
+
381
+ (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
382
+
383
+ Processing by StaticPagesController#home as HTML
384
+
385
+ Rendering layout layouts/application.html.erb
386
+
387
+ Rendering static_pages/home.html.erb within layouts/application
388
+
389
+ Rendered static_pages/home.html.erb within layouts/application (Duration: 1.8ms | Allocations: 557)
390
+
391
+ [Webpacker] Compiling...
392
+
393
+ [Webpacker] Compilation failed:
394
+
395
+ Hash: fdeeca607e1e499129f7
396
+
397
+ Version: webpack 4.46.0
398
+
399
+ Time: 1529ms
400
+
401
+ Built at: 2021/12/18 16:54:42
402
+
403
+ Asset Size Chunks Chunk Names
404
+
405
+ js/application-7c8532601664106d1dd3.js 1020 KiB application [emitted] [immutable] application
406
+
407
+ js/application-7c8532601664106d1dd3.js.map 1.08 MiB application [emitted] [dev] application
408
+
409
+ manifest.json 364 bytes [emitted]
410
+
411
+ Entrypoint application = js/application-7c8532601664106d1dd3.js js/application-7c8532601664106d1dd3.js.map
412
+
413
+ [./app/javascript/channels sync recursive _channel.js$] ./app/javascript/channels sync _channel.js$ 160 bytes {application} [built]
414
+
415
+ [./app/javascript/channels/index.js] 211 bytes {application} [built]
416
+
417
+ [./app/javascript/packs/application.js] 780 bytes {application} [built]
418
+
419
+ [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 552 bytes {application} [built]
420
+
421
+ + 112 hidden modules
422
+
423
+
424
+
425
+ ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js
426
+
427
+ Module not found: Error: Can't resolve '@popperjs/core' in '/Users/name/name/applicationname/node_modules/bootstrap/dist/js'
428
+
429
+ @ ./node_modules/bootstrap/dist/js/bootstrap.esm.js 60:0-41 2356:17-23 2375:21-40 4029:15-21 4164:23-42
430
+
431
+ @ ./app/javascript/packs/application.js
432
+
433
+
434
+
435
+ Rendered layouts/_head.html.erb (Duration: 2434.1ms | Allocations: 19838)
436
+
437
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
438
+
439
+ ↳ app/helpers/sessions_helper.rb:12:in `current_user'
440
+
441
+ Rendered layouts/_header.html.erb (Duration: 7.0ms | Allocations: 6717)
442
+
443
+ Rendered layouts/_footer.html.erb (Duration: 0.3ms | Allocations: 176)
444
+
445
+ Rendered layout layouts/application.html.erb (Duration: 2444.6ms | Allocations: 28332)
446
+
447
+ Completed 200 OK in 2455ms (Views: 2449.5ms | ActiveRecord: 0.4ms | Allocations: 32364)
448
+
449
+
450
+
451
+
452
+
453
+ Started GET "/logout" for 127.0.0.1 at 2021-12-18 16:54:50 +0900
454
+
455
+
456
+
457
+ ActionController::RoutingError (No route matches [GET] "/logout"):
458
+
459
+
460
+
461
+ Started GET "/logout" for 127.0.0.1 at 2021-12-18 16:55:08 +0900
462
+
463
+ Processing by SessionsController#destroy as HTML
464
+
465
+ Redirected to http://127.0.0.1:3000/
466
+
467
+ Completed 302 Found in 1ms (Allocations: 428)
468
+
469
+ ```
470
+
471
+
472
+
473
+
474
+
375
475
  # 各バージョン
376
476
 
377
477
 

1

_header.html.erbを追加

2021/12/18 09:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -108,6 +108,72 @@
108
108
 
109
109
  ```
110
110
 
111
+ 続いて下記はheader部分のソースコードです。
112
+
113
+ ```html
114
+
115
+ <header class="navbar navbar-fixed-top navbar-inverse">
116
+
117
+ <div class="container">
118
+
119
+ <%= link_to "GYMOHA APP", root_path, id: "logo" %>
120
+
121
+ <nav>
122
+
123
+ <ul class="nav navbar-nav navbar-right">
124
+
125
+ <li><%= link_to "ホーム", root_path %></li>
126
+
127
+ <li><%= link_to "GYMOHAとは?", about_path %></li>
128
+
129
+ <% if logged_in? %>
130
+
131
+ <li><%= link_to "ユーザー", '#' %></li>
132
+
133
+ <li class="dropdown">
134
+
135
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
136
+
137
+ アカウント <b class="caret"></b>
138
+
139
+ </a>
140
+
141
+ <ul class="dropdown-menu">
142
+
143
+ <li><%= link_to "プロフィール", current_user %></li>
144
+
145
+ <li><%= link_to "設定", '#' %></li>
146
+
147
+ <li class="divider"></li>
148
+
149
+ <li>
150
+
151
+ <%= link_to "ログアウト", logout_path, method: :delete %>
152
+
153
+ </li>
154
+
155
+ </ul>
156
+
157
+ </li>
158
+
159
+ <% else %>
160
+
161
+ <li><%= link_to "ログイン", login_path %></li>
162
+
163
+ <% end %>
164
+
165
+ </ul>
166
+
167
+ </nav>
168
+
169
+ </div>
170
+
171
+ </header>
172
+
173
+ ```
174
+
175
+ 続いて下記はgemfileです。
176
+
111
177
  ```gemfile
112
178
 
113
179
  source 'https://rubygems.org'