teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

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

2019/12/24 13:36

投稿

keeperkazuyo
keeperkazuyo

スコア5

title CHANGED
File without changes
body CHANGED
@@ -60,7 +60,173 @@
60
60
  password: pass_production
61
61
  ```
62
62
 
63
+ ```
64
+ production.rb
63
65
 
66
+ Rails.application.configure do
67
+ # Settings specified here will take precedence over those in config/application.rb.
68
+
69
+ # Code is not reloaded between requests.
70
+ config.cache_classes = true
71
+
72
+ # Eager load code on boot. This eager loads most of Rails and
73
+ # your application in memory, allowing both threaded web servers
74
+ # and those relying on copy on write to perform better.
75
+ # Rake tasks automatically ignore this option for performance.
76
+ config.eager_load = true
77
+
78
+ # Full error reports are disabled and caching is turned on.
79
+ config.consider_all_requests_local = false
80
+ config.action_controller.perform_caching = true
81
+
82
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
83
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
84
+ # config.require_master_key = true
85
+
86
+ # Disable serving static files from the `/public` folder by default since
87
+ # Apache or NGINX already handles this.
88
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
89
+
90
+ # Compress JavaScripts and CSS.
91
+ config.assets.js_compressor = :uglifier
92
+ # config.assets.css_compressor = :sass
93
+
94
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
95
+ config.assets.compile = false
96
+
97
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
98
+
99
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
100
+ # config.action_controller.asset_host = 'http://assets.example.com'
101
+
102
+ # Specifies the header that your server uses for sending files.
103
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
104
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
105
+
106
+ # Store uploaded files on the local file system (see config/storage.yml for options)
107
+ config.active_storage.service = :local
108
+
109
+ # Mount Action Cable outside main process or domain
110
+ # config.action_cable.mount_path = nil
111
+ # config.action_cable.url = 'wss://example.com/cable'
112
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ]
113
+
114
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
115
+ # config.force_ssl = true
116
+
117
+ # Use the lowest log level to ensure availability of diagnostic information
118
+ # when problems arise.
119
+ config.log_level = :debug
120
+
121
+ # Prepend all log lines with the following tags.
122
+ config.log_tags = [ :request_id ]
123
+
124
+ # Use a different cache store in production.
125
+ # config.cache_store = :mem_cache_store
126
+
127
+ # Use a real queuing backend for Active Job (and separate queues per environment)
128
+ # config.active_job.queue_adapter = :resque
129
+ # config.active_job.queue_name_prefix = "eof_app_#{Rails.env}"
130
+
131
+ config.action_mailer.perform_caching = false
132
+
133
+ # Ignore bad email addresses and do not raise email delivery errors.
134
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
135
+ # config.action_mailer.raise_delivery_errors = false
136
+
137
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
138
+ # the I18n.default_locale when a translation cannot be found).
139
+ config.i18n.fallbacks = true
140
+
141
+ # Send deprecation notices to registered listeners.
142
+ config.active_support.deprecation = :notify
143
+
144
+ # Use default logging formatter so that PID and timestamp are not suppressed.
145
+ config.log_formatter = ::Logger::Formatter.new
146
+
147
+ # Use a different logger for distributed setups.
148
+ # require 'syslog/logger'
149
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
150
+
151
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
152
+ logger = ActiveSupport::Logger.new(STDOUT)
153
+ logger.formatter = config.log_formatter
154
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
155
+ end
156
+
157
+ # Do not dump schema after migrations.
158
+ config.active_record.dump_schema_after_migration = false
159
+ end
160
+
161
+ ```
162
+ ```
163
+ development.rb
164
+
165
+ Rails.application.configure do
166
+ # Settings specified here will take precedence over those in config/application.rb.
167
+
168
+ # In the development environment your application's code is reloaded on
169
+ # every request. This slows down response time but is perfect for development
170
+ # since you don't have to restart the web server when you make code changes.
171
+ config.cache_classes = false
172
+
173
+ # Do not eager load code on boot.
174
+ config.eager_load = false
175
+
176
+ # Show full error reports.
177
+ config.consider_all_requests_local = true
178
+
179
+ # Enable/disable caching. By default caching is disabled.
180
+ # Run rails dev:cache to toggle caching.
181
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
182
+ config.action_controller.perform_caching = true
183
+
184
+ config.cache_store = :memory_store
185
+ config.public_file_server.headers = {
186
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
187
+ }
188
+ else
189
+ config.action_controller.perform_caching = false
190
+
191
+ config.cache_store = :null_store
192
+ end
193
+
194
+ # Store uploaded files on the local file system (see config/storage.yml for options)
195
+ config.active_storage.service = :local
196
+
197
+ # Don't care if the mailer can't send.
198
+ config.action_mailer.raise_delivery_errors = false
199
+
200
+ config.action_mailer.perform_caching = false
201
+
202
+ # Print deprecation notices to the Rails logger.
203
+ config.active_support.deprecation = :log
204
+
205
+ # Raise an error on page load if there are pending migrations.
206
+ config.active_record.migration_error = :page_load
207
+
208
+ # Highlight code that triggered database queries in logs.
209
+ config.active_record.verbose_query_logs = true
210
+
211
+ # Debug mode disables concatenation and preprocessing of assets.
212
+ # This option may cause significant delays in view rendering with a large
213
+ # number of complex assets.
214
+ config.assets.debug = true
215
+
216
+ # Suppress logger output for asset requests.
217
+ config.assets.quiet = true
218
+
219
+ # Raises error for missing translations
220
+ # config.action_view.raise_on_missing_translations = true
221
+
222
+ # Use an evented file watcher to asynchronously detect changes in source code,
223
+ # routes, locales, etc. This feature depends on the listen gem.
224
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
225
+ #mailer setting
226
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
227
+ end
228
+
229
+ ```
64
230
  ### 試したこと
65
231
 
66
232
  調べられる限りのことはしたのですが、解決方法がわかりません。

1

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

2019/12/24 13:36

投稿

keeperkazuyo
keeperkazuyo

スコア5

title CHANGED
File without changes
body CHANGED
@@ -29,7 +29,38 @@
29
29
  # Initialize the Rails application.
30
30
  Rails.application.initialize!
31
31
  ```
32
+ ```
33
+ /config/database.yml
32
34
 
35
+
36
+ default: &default
37
+ adapter: mysql2
38
+ encoding: utf8
39
+ reconnect: false
40
+ pool: 5
41
+ socket: /var/lib/mysql/mysql.sock
42
+
43
+
44
+ development:
45
+ <<: *default
46
+ database: アプリ名_development
47
+ username: user_development
48
+ password: pass_development
49
+
50
+ test:
51
+ <<: *default
52
+ database: アプリ名_test
53
+ username: user_test
54
+ password: pass_test
55
+
56
+ production:
57
+ <<: *default
58
+ database: アプリ名_production
59
+ username: user_production
60
+ password: pass_production
61
+ ```
62
+
63
+
33
64
  ### 試したこと
34
65
 
35
66
  調べられる限りのことはしたのですが、解決方法がわかりません。