質問編集履歴

2

タイトルを修正

2021/11/06 10:21

投稿

shohei_mlb
shohei_mlb

スコア9

test CHANGED
@@ -1 +1 @@
1
- No route matches [GET] "/auth/google_oauth2"を解決したい
1
+ 【お助けください】No route matches [GET] "/auth/google_oauth2"を解決したい
test CHANGED
File without changes

1

修正

2021/11/06 10:21

投稿

shohei_mlb
shohei_mlb

スコア9

test CHANGED
File without changes
test CHANGED
@@ -42,573 +42,129 @@
42
42
 
43
43
 
44
44
 
45
- ■Gemfile.lock
45
+ ■Gemfile
46
46
 
47
47
  ```Ruby
48
48
 
49
- GEM
50
-
51
- remote: https://rubygems.org/
52
-
53
- specs:
54
-
55
- actioncable (6.1.4.1)
56
-
57
- actionpack (= 6.1.4.1)
58
-
59
- activesupport (= 6.1.4.1)
60
-
61
- nio4r (~> 2.0)
62
-
63
- websocket-driver (>= 0.6.1)
64
-
65
- actionmailbox (6.1.4.1)
66
-
67
- actionpack (= 6.1.4.1)
68
-
69
- activejob (= 6.1.4.1)
70
-
71
- activerecord (= 6.1.4.1)
72
-
73
- activestorage (= 6.1.4.1)
74
-
75
- activesupport (= 6.1.4.1)
76
-
77
- mail (>= 2.7.1)
78
-
79
- actionmailer (6.1.4.1)
80
-
81
- actionpack (= 6.1.4.1)
82
-
83
- actionview (= 6.1.4.1)
84
-
85
- activejob (= 6.1.4.1)
86
-
87
- activesupport (= 6.1.4.1)
88
-
89
- mail (~> 2.5, >= 2.5.4)
90
-
91
- rails-dom-testing (~> 2.0)
92
-
93
- actionpack (6.1.4.1)
94
-
95
- actionview (= 6.1.4.1)
96
-
97
- activesupport (= 6.1.4.1)
98
-
99
- rack (~> 2.0, >= 2.0.9)
100
-
101
- rack-test (>= 0.6.3)
102
-
103
- rails-dom-testing (~> 2.0)
104
-
105
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
106
-
107
- actiontext (6.1.4.1)
108
-
109
- actionpack (= 6.1.4.1)
110
-
111
- activerecord (= 6.1.4.1)
112
-
113
- activestorage (= 6.1.4.1)
114
-
115
- activesupport (= 6.1.4.1)
116
-
117
- nokogiri (>= 1.8.5)
118
-
119
- actionview (6.1.4.1)
120
-
121
- activesupport (= 6.1.4.1)
122
-
123
- builder (~> 3.1)
124
-
125
- erubi (~> 1.4)
126
-
127
- rails-dom-testing (~> 2.0)
128
-
129
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
130
-
131
- activejob (6.1.4.1)
132
-
133
- activesupport (= 6.1.4.1)
134
-
135
- globalid (>= 0.3.6)
136
-
137
- activemodel (6.1.4.1)
138
-
139
- activesupport (= 6.1.4.1)
140
-
141
- activerecord (6.1.4.1)
142
-
143
- activemodel (= 6.1.4.1)
144
-
145
- activesupport (= 6.1.4.1)
146
-
147
- activestorage (6.1.4.1)
148
-
149
- actionpack (= 6.1.4.1)
150
-
151
- activejob (= 6.1.4.1)
152
-
153
- activerecord (= 6.1.4.1)
154
-
155
- activesupport (= 6.1.4.1)
156
-
157
- marcel (~> 1.0.0)
158
-
159
- mini_mime (>= 1.1.0)
160
-
161
- activesupport (6.1.4.1)
162
-
163
- concurrent-ruby (~> 1.0, >= 1.0.2)
164
-
165
- i18n (>= 1.6, < 2)
166
-
167
- minitest (>= 5.1)
168
-
169
- tzinfo (~> 2.0)
170
-
171
- zeitwerk (~> 2.3)
172
-
173
- addressable (2.8.0)
174
-
175
- public_suffix (>= 2.0.2, < 5.0)
176
-
177
- better_errors (2.9.1)
178
-
179
- coderay (>= 1.0.0)
180
-
181
- erubi (>= 1.0.0)
182
-
183
- rack (>= 0.9.0)
184
-
185
- bindex (0.8.1)
186
-
187
- bootsnap (1.9.1)
188
-
189
- msgpack (~> 1.0)
190
-
191
- builder (3.2.4)
192
-
193
- byebug (11.1.3)
194
-
195
- capybara (3.35.3)
196
-
197
- addressable
198
-
199
- mini_mime (>= 0.1.3)
200
-
201
- nokogiri (~> 1.8)
202
-
203
- rack (>= 1.6.0)
204
-
205
- rack-test (>= 0.6.3)
206
-
207
- regexp_parser (>= 1.5, < 3.0)
208
-
209
- xpath (~> 3.2)
210
-
211
- childprocess (3.0.0)
212
-
213
- coderay (1.1.3)
214
-
215
- concurrent-ruby (1.1.9)
216
-
217
- crass (1.0.6)
218
-
219
- dotenv (2.7.6)
220
-
221
- dotenv-rails (2.7.6)
222
-
223
- dotenv (= 2.7.6)
224
-
225
- railties (>= 3.2)
226
-
227
- erubi (1.10.0)
228
-
229
- faraday (1.8.0)
230
-
231
- faraday-em_http (~> 1.0)
232
-
233
- faraday-em_synchrony (~> 1.0)
234
-
235
- faraday-excon (~> 1.1)
236
-
237
- faraday-httpclient (~> 1.0.1)
238
-
239
- faraday-net_http (~> 1.0)
240
-
241
- faraday-net_http_persistent (~> 1.1)
242
-
243
- faraday-patron (~> 1.0)
244
-
245
- faraday-rack (~> 1.0)
246
-
247
- multipart-post (>= 1.2, < 3)
248
-
249
- ruby2_keywords (>= 0.0.4)
250
-
251
- faraday-em_http (1.0.0)
252
-
253
- faraday-em_synchrony (1.0.0)
254
-
255
- faraday-excon (1.1.0)
256
-
257
- faraday-httpclient (1.0.1)
258
-
259
- faraday-net_http (1.0.1)
260
-
261
- faraday-net_http_persistent (1.2.0)
262
-
263
- faraday-patron (1.0.0)
264
-
265
- faraday-rack (1.0.0)
266
-
267
- ffi (1.15.4)
268
-
269
- globalid (0.5.2)
270
-
271
- activesupport (>= 5.0)
272
-
273
- hashie (4.1.0)
274
-
275
- i18n (1.8.10)
276
-
277
- concurrent-ruby (~> 1.0)
278
-
279
- jbuilder (2.11.2)
280
-
281
- activesupport (>= 5.0.0)
282
-
283
- jwt (2.3.0)
284
-
285
- listen (3.7.0)
286
-
287
- rb-fsevent (~> 0.10, >= 0.10.3)
288
-
289
- rb-inotify (~> 0.9, >= 0.9.10)
290
-
291
- loofah (2.12.0)
292
-
293
- crass (~> 1.0.2)
294
-
295
- nokogiri (>= 1.5.9)
296
-
297
- mail (2.7.1)
298
-
299
- mini_mime (>= 0.1.1)
300
-
301
- marcel (1.0.2)
302
-
303
- method_source (1.0.0)
304
-
305
- mini_mime (1.1.1)
306
-
307
- minitest (5.14.4)
308
-
309
- msgpack (1.4.2)
310
-
311
- multi_json (1.15.0)
312
-
313
- multi_xml (0.6.0)
314
-
315
- multipart-post (2.1.1)
316
-
317
- nio4r (2.5.8)
318
-
319
- nokogiri (1.12.5-arm64-darwin)
320
-
321
- racc (~> 1.4)
322
-
323
- oauth2 (1.4.7)
324
-
325
- faraday (>= 0.8, < 2.0)
326
-
327
- jwt (>= 1.0, < 3.0)
328
-
329
- multi_json (~> 1.3)
330
-
331
- multi_xml (~> 0.5)
332
-
333
- rack (>= 1.2, < 3)
334
-
335
- omniauth (2.0.4)
336
-
337
- hashie (>= 3.4.6)
338
-
339
- rack (>= 1.6.2, < 3)
340
-
341
- rack-protection
342
-
343
- omniauth-google-oauth2 (1.0.0)
344
-
345
- jwt (>= 2.0)
346
-
347
- oauth2 (~> 1.1)
348
-
349
- omniauth (~> 2.0)
350
-
351
- omniauth-oauth2 (~> 1.7.1)
352
-
353
- omniauth-oauth2 (1.7.2)
354
-
355
- oauth2 (~> 1.4)
356
-
357
- omniauth (>= 1.9, < 3)
358
-
359
- public_suffix (4.0.6)
360
-
361
- puma (5.5.0)
362
-
363
- nio4r (~> 2.0)
364
-
365
- racc (1.5.2)
366
-
367
- rack (2.2.3)
368
-
369
- rack-mini-profiler (2.3.3)
370
-
371
- rack (>= 1.2.0)
372
-
373
- rack-protection (2.1.0)
374
-
375
- rack
376
-
377
- rack-proxy (0.7.0)
378
-
379
- rack
380
-
381
- rack-test (1.1.0)
382
-
383
- rack (>= 1.0, < 3)
384
-
385
- rails (6.1.4.1)
386
-
387
- actioncable (= 6.1.4.1)
388
-
389
- actionmailbox (= 6.1.4.1)
390
-
391
- actionmailer (= 6.1.4.1)
392
-
393
- actionpack (= 6.1.4.1)
394
-
395
- actiontext (= 6.1.4.1)
396
-
397
- actionview (= 6.1.4.1)
398
-
399
- activejob (= 6.1.4.1)
400
-
401
- activemodel (= 6.1.4.1)
402
-
403
- activerecord (= 6.1.4.1)
404
-
405
- activestorage (= 6.1.4.1)
406
-
407
- activesupport (= 6.1.4.1)
408
-
409
- bundler (>= 1.15.0)
410
-
411
- railties (= 6.1.4.1)
412
-
413
- sprockets-rails (>= 2.0.0)
414
-
415
- rails-dom-testing (2.0.3)
416
-
417
- activesupport (>= 4.2.0)
418
-
419
- nokogiri (>= 1.6)
420
-
421
- rails-html-sanitizer (1.4.2)
422
-
423
- loofah (~> 2.3)
424
-
425
- railties (6.1.4.1)
426
-
427
- actionpack (= 6.1.4.1)
428
-
429
- activesupport (= 6.1.4.1)
430
-
431
- method_source
432
-
433
- rake (>= 0.13)
434
-
435
- thor (~> 1.0)
436
-
437
- rake (13.0.6)
438
-
439
- rb-fsevent (0.11.0)
440
-
441
- rb-inotify (0.10.1)
442
-
443
- ffi (~> 1.0)
444
-
445
- regexp_parser (2.1.1)
446
-
447
- ruby2_keywords (0.0.5)
448
-
449
- rubyzip (2.3.2)
450
-
451
- sass-rails (6.0.0)
452
-
453
- sassc-rails (~> 2.1, >= 2.1.1)
454
-
455
- sassc (2.4.0)
456
-
457
- ffi (~> 1.9)
458
-
459
- sassc-rails (2.1.2)
460
-
461
- railties (>= 4.0.0)
462
-
463
- sassc (>= 2.0)
464
-
465
- sprockets (> 3.0)
466
-
467
- sprockets-rails
468
-
469
- tilt
470
-
471
- selenium-webdriver (3.142.7)
472
-
473
- childprocess (>= 0.5, < 4.0)
474
-
475
- rubyzip (>= 1.2.2)
476
-
477
- semantic_range (3.0.0)
478
-
479
- spring (3.0.0)
480
-
481
- sprockets (4.0.2)
482
-
483
- concurrent-ruby (~> 1.0)
484
-
485
- rack (> 1, < 3)
486
-
487
- sprockets-rails (3.2.2)
488
-
489
- actionpack (>= 4.0)
490
-
491
- activesupport (>= 4.0)
492
-
493
- sprockets (>= 3.0.0)
494
-
495
- sqlite3 (1.4.2)
496
-
497
- thor (1.1.0)
498
-
499
- tilt (2.0.10)
500
-
501
- turbolinks (5.2.1)
502
-
503
- turbolinks-source (~> 5.2)
504
-
505
- turbolinks-source (5.2.0)
506
-
507
- tzinfo (2.0.4)
508
-
509
- concurrent-ruby (~> 1.0)
510
-
511
- web-console (4.1.0)
512
-
513
- actionview (>= 6.0.0)
514
-
515
- activemodel (>= 6.0.0)
516
-
517
- bindex (>= 0.4.0)
518
-
519
- railties (>= 6.0.0)
520
-
521
- webdrivers (4.6.1)
522
-
523
- nokogiri (~> 1.6)
524
-
525
- rubyzip (>= 1.3.0)
526
-
527
- selenium-webdriver (>= 3.0, < 4.0)
528
-
529
- webpacker (5.4.3)
530
-
531
- activesupport (>= 5.2)
532
-
533
- rack-proxy (>= 0.6.1)
534
-
535
- railties (>= 5.2)
536
-
537
- semantic_range (>= 2.3.0)
538
-
539
- websocket-driver (0.7.5)
540
-
541
- websocket-extensions (>= 0.1.0)
542
-
543
- websocket-extensions (0.1.5)
544
-
545
- xpath (3.2.0)
546
-
547
- nokogiri (~> 1.8)
548
-
549
- zeitwerk (2.4.2)
550
-
551
-
552
-
553
- PLATFORMS
554
-
555
- arm64-darwin-20
556
-
557
-
558
-
559
- DEPENDENCIES
560
-
561
- better_errors
562
-
563
- bootsnap (>= 1.4.4)
564
-
565
- byebug
566
-
567
- capybara (>= 3.26)
568
-
569
- dotenv-rails
570
-
571
- jbuilder (~> 2.7)
572
-
573
- listen (~> 3.3)
574
-
575
- omniauth-google-oauth2
576
-
577
- puma (~> 5.0)
578
-
579
- rack-mini-profiler (~> 2.0)
580
-
581
- rails (~> 6.1.4, >= 6.1.4.1)
582
-
583
- sass-rails (>= 6)
584
-
585
- selenium-webdriver
586
-
587
- spring
588
-
589
- sqlite3 (~> 1.4)
590
-
591
- turbolinks (~> 5)
592
-
593
- tzinfo-data
594
-
595
- web-console (>= 4.1.0)
596
-
597
- webdrivers
598
-
599
- webpacker (~> 5.0)
600
-
601
-
602
-
603
- RUBY VERSION
604
-
605
- ruby 3.0.0p0
606
-
607
-
608
-
609
- BUNDLED WITH
610
-
611
- 2.2.3
49
+ source 'https://rubygems.org'
50
+
51
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
52
+
53
+
54
+
55
+ ruby '3.0.0'
56
+
57
+
58
+
59
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
60
+
61
+ gem 'rails', '~> 6.1.4', '>= 6.1.4.1'
62
+
63
+ # Use sqlite3 as the database for Active Record
64
+
65
+ gem 'sqlite3', '~> 1.4'
66
+
67
+ # Use Puma as the app server
68
+
69
+ gem 'puma', '~> 5.0'
70
+
71
+ # Use SCSS for stylesheets
72
+
73
+ gem 'sass-rails', '>= 6'
74
+
75
+ # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
76
+
77
+ gem 'webpacker', '~> 5.0'
78
+
79
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
80
+
81
+ gem 'turbolinks', '~> 5'
82
+
83
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
84
+
85
+ gem 'jbuilder', '~> 2.7'
86
+
87
+ # Use Redis adapter to run Action Cable in production
88
+
89
+ # gem 'redis', '~> 4.0'
90
+
91
+ # Use Active Model has_secure_password
92
+
93
+ # gem 'bcrypt', '~> 3.1.7'
94
+
95
+
96
+
97
+ # Use Active Storage variant
98
+
99
+ # gem 'image_processing', '~> 1.2'
100
+
101
+
102
+
103
+ # Reduces boot times through caching; required in config/boot.rb
104
+
105
+ gem 'bootsnap', '>= 1.4.4', require: false
106
+
107
+
108
+
109
+ gem 'omniauth-google-oauth2'
110
+
111
+
112
+
113
+ group :development, :test do
114
+
115
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
116
+
117
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
118
+
119
+ gem 'dotenv-rails'
120
+
121
+ end
122
+
123
+
124
+
125
+ group :development do
126
+
127
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
128
+
129
+ gem 'web-console', '>= 4.1.0'
130
+
131
+ # Display performance information such as SQL time and flame graphs for each request in your browser.
132
+
133
+ # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
134
+
135
+ gem 'rack-mini-profiler', '~> 2.0'
136
+
137
+ gem 'listen', '~> 3.3'
138
+
139
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
140
+
141
+ gem 'spring'
142
+
143
+ gem 'better_errors'
144
+
145
+ end
146
+
147
+
148
+
149
+ group :test do
150
+
151
+ # Adds support for Capybara system testing and selenium driver
152
+
153
+ gem 'capybara', '>= 3.26'
154
+
155
+ gem 'selenium-webdriver'
156
+
157
+ # Easy installation and use of web drivers to run system tests with browsers
158
+
159
+ gem 'webdrivers'
160
+
161
+ end
162
+
163
+
164
+
165
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
166
+
167
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
612
168
 
613
169
  ```
614
170
 
@@ -741,3 +297,43 @@
741
297
  end
742
298
 
743
299
  ```
300
+
301
+
302
+
303
+ ■app/views/posts/index.html.erb
304
+
305
+ ```ruby
306
+
307
+ <h1>Post#index</h1>
308
+
309
+ <p>Find me in app/views/posts/index.html.erb</p>
310
+
311
+ <%= link_to "Sign in with Google", "/auth/google_oauth2", id: "sign_in" %>
312
+
313
+ ```
314
+
315
+
316
+
317
+ ■config/initializers/omniauth.rb
318
+
319
+ ```ruby
320
+
321
+ Rails.application.config.middleware.use OmniAuth::Builder do
322
+
323
+ provider :google_oauth2, ENV["GOOGLE_CLIENT_ID"], ENV["GOOGLE_CLIENT_SECRET"]
324
+
325
+ end
326
+
327
+ ```
328
+
329
+
330
+
331
+ ■.env
332
+
333
+ ```ruby
334
+
335
+ GOOGLE_CLIENT_ID="======================"
336
+
337
+ GOOGLE_CLIENT_SECRET="=================="
338
+
339
+ ```