質問編集履歴

2

development.rb ,production.rbソースコード追記しました

2019/12/24 13:36

投稿

keeperkazuyo
keeperkazuyo

スコア5

test CHANGED
File without changes
test CHANGED
@@ -122,7 +122,339 @@
122
122
 
123
123
 
124
124
 
125
-
125
+ ```
126
+
127
+ production.rb
128
+
129
+
130
+
131
+ Rails.application.configure do
132
+
133
+ # Settings specified here will take precedence over those in config/application.rb.
134
+
135
+
136
+
137
+ # Code is not reloaded between requests.
138
+
139
+ config.cache_classes = true
140
+
141
+
142
+
143
+ # Eager load code on boot. This eager loads most of Rails and
144
+
145
+ # your application in memory, allowing both threaded web servers
146
+
147
+ # and those relying on copy on write to perform better.
148
+
149
+ # Rake tasks automatically ignore this option for performance.
150
+
151
+ config.eager_load = true
152
+
153
+
154
+
155
+ # Full error reports are disabled and caching is turned on.
156
+
157
+ config.consider_all_requests_local = false
158
+
159
+ config.action_controller.perform_caching = true
160
+
161
+
162
+
163
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
164
+
165
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
166
+
167
+ # config.require_master_key = true
168
+
169
+
170
+
171
+ # Disable serving static files from the `/public` folder by default since
172
+
173
+ # Apache or NGINX already handles this.
174
+
175
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
176
+
177
+
178
+
179
+ # Compress JavaScripts and CSS.
180
+
181
+ config.assets.js_compressor = :uglifier
182
+
183
+ # config.assets.css_compressor = :sass
184
+
185
+
186
+
187
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
188
+
189
+ config.assets.compile = false
190
+
191
+
192
+
193
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
194
+
195
+
196
+
197
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
198
+
199
+ # config.action_controller.asset_host = 'http://assets.example.com'
200
+
201
+
202
+
203
+ # Specifies the header that your server uses for sending files.
204
+
205
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
206
+
207
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
208
+
209
+
210
+
211
+ # Store uploaded files on the local file system (see config/storage.yml for options)
212
+
213
+ config.active_storage.service = :local
214
+
215
+
216
+
217
+ # Mount Action Cable outside main process or domain
218
+
219
+ # config.action_cable.mount_path = nil
220
+
221
+ # config.action_cable.url = 'wss://example.com/cable'
222
+
223
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ]
224
+
225
+
226
+
227
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
228
+
229
+ # config.force_ssl = true
230
+
231
+
232
+
233
+ # Use the lowest log level to ensure availability of diagnostic information
234
+
235
+ # when problems arise.
236
+
237
+ config.log_level = :debug
238
+
239
+
240
+
241
+ # Prepend all log lines with the following tags.
242
+
243
+ config.log_tags = [ :request_id ]
244
+
245
+
246
+
247
+ # Use a different cache store in production.
248
+
249
+ # config.cache_store = :mem_cache_store
250
+
251
+
252
+
253
+ # Use a real queuing backend for Active Job (and separate queues per environment)
254
+
255
+ # config.active_job.queue_adapter = :resque
256
+
257
+ # config.active_job.queue_name_prefix = "eof_app_#{Rails.env}"
258
+
259
+
260
+
261
+ config.action_mailer.perform_caching = false
262
+
263
+
264
+
265
+ # Ignore bad email addresses and do not raise email delivery errors.
266
+
267
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
268
+
269
+ # config.action_mailer.raise_delivery_errors = false
270
+
271
+
272
+
273
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
274
+
275
+ # the I18n.default_locale when a translation cannot be found).
276
+
277
+ config.i18n.fallbacks = true
278
+
279
+
280
+
281
+ # Send deprecation notices to registered listeners.
282
+
283
+ config.active_support.deprecation = :notify
284
+
285
+
286
+
287
+ # Use default logging formatter so that PID and timestamp are not suppressed.
288
+
289
+ config.log_formatter = ::Logger::Formatter.new
290
+
291
+
292
+
293
+ # Use a different logger for distributed setups.
294
+
295
+ # require 'syslog/logger'
296
+
297
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
298
+
299
+
300
+
301
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
302
+
303
+ logger = ActiveSupport::Logger.new(STDOUT)
304
+
305
+ logger.formatter = config.log_formatter
306
+
307
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
308
+
309
+ end
310
+
311
+
312
+
313
+ # Do not dump schema after migrations.
314
+
315
+ config.active_record.dump_schema_after_migration = false
316
+
317
+ end
318
+
319
+
320
+
321
+ ```
322
+
323
+ ```
324
+
325
+ development.rb
326
+
327
+
328
+
329
+ Rails.application.configure do
330
+
331
+ # Settings specified here will take precedence over those in config/application.rb.
332
+
333
+
334
+
335
+ # In the development environment your application's code is reloaded on
336
+
337
+ # every request. This slows down response time but is perfect for development
338
+
339
+ # since you don't have to restart the web server when you make code changes.
340
+
341
+ config.cache_classes = false
342
+
343
+
344
+
345
+ # Do not eager load code on boot.
346
+
347
+ config.eager_load = false
348
+
349
+
350
+
351
+ # Show full error reports.
352
+
353
+ config.consider_all_requests_local = true
354
+
355
+
356
+
357
+ # Enable/disable caching. By default caching is disabled.
358
+
359
+ # Run rails dev:cache to toggle caching.
360
+
361
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
362
+
363
+ config.action_controller.perform_caching = true
364
+
365
+
366
+
367
+ config.cache_store = :memory_store
368
+
369
+ config.public_file_server.headers = {
370
+
371
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
372
+
373
+ }
374
+
375
+ else
376
+
377
+ config.action_controller.perform_caching = false
378
+
379
+
380
+
381
+ config.cache_store = :null_store
382
+
383
+ end
384
+
385
+
386
+
387
+ # Store uploaded files on the local file system (see config/storage.yml for options)
388
+
389
+ config.active_storage.service = :local
390
+
391
+
392
+
393
+ # Don't care if the mailer can't send.
394
+
395
+ config.action_mailer.raise_delivery_errors = false
396
+
397
+
398
+
399
+ config.action_mailer.perform_caching = false
400
+
401
+
402
+
403
+ # Print deprecation notices to the Rails logger.
404
+
405
+ config.active_support.deprecation = :log
406
+
407
+
408
+
409
+ # Raise an error on page load if there are pending migrations.
410
+
411
+ config.active_record.migration_error = :page_load
412
+
413
+
414
+
415
+ # Highlight code that triggered database queries in logs.
416
+
417
+ config.active_record.verbose_query_logs = true
418
+
419
+
420
+
421
+ # Debug mode disables concatenation and preprocessing of assets.
422
+
423
+ # This option may cause significant delays in view rendering with a large
424
+
425
+ # number of complex assets.
426
+
427
+ config.assets.debug = true
428
+
429
+
430
+
431
+ # Suppress logger output for asset requests.
432
+
433
+ config.assets.quiet = true
434
+
435
+
436
+
437
+ # Raises error for missing translations
438
+
439
+ # config.action_view.raise_on_missing_translations = true
440
+
441
+
442
+
443
+ # Use an evented file watcher to asynchronously detect changes in source code,
444
+
445
+ # routes, locales, etc. This feature depends on the listen gem.
446
+
447
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
448
+
449
+ #mailer setting
450
+
451
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
452
+
453
+ end
454
+
455
+
456
+
457
+ ```
126
458
 
127
459
  ### 試したこと
128
460
 

1

database.ymlの内容も追記しました

2019/12/24 13:36

投稿

keeperkazuyo
keeperkazuyo

スコア5

test CHANGED
File without changes
test CHANGED
@@ -60,6 +60,68 @@
60
60
 
61
61
  ```
62
62
 
63
+ ```
64
+
65
+ /config/database.yml
66
+
67
+
68
+
69
+
70
+
71
+ default: &default
72
+
73
+ adapter: mysql2
74
+
75
+ encoding: utf8
76
+
77
+ reconnect: false
78
+
79
+ pool: 5
80
+
81
+ socket: /var/lib/mysql/mysql.sock
82
+
83
+
84
+
85
+
86
+
87
+ development:
88
+
89
+ <<: *default
90
+
91
+ database: アプリ名_development
92
+
93
+ username: user_development
94
+
95
+ password: pass_development
96
+
97
+
98
+
99
+ test:
100
+
101
+ <<: *default
102
+
103
+ database: アプリ名_test
104
+
105
+ username: user_test
106
+
107
+ password: pass_test
108
+
109
+
110
+
111
+ production:
112
+
113
+ <<: *default
114
+
115
+ database: アプリ名_production
116
+
117
+ username: user_production
118
+
119
+ password: pass_production
120
+
121
+ ```
122
+
123
+
124
+
63
125
 
64
126
 
65
127
  ### 試したこと