###前提・実現したいこと
RailsアプリをAWSにデプロイしてCSSを適用したいです。
###発生している問題・エラーメッセージ
本番環境でCSSが適用されません。
http://52.193.137.191/
###該当のソースコード
environments/development.rb
Rails.application.configure do config.cache_classes = false config.eager_load = false config.consider_all_requests_local = true if Rails.root.join('tmp/caching-dev.txt').exist? config.action_controller.perform_caching = true config.cache_store = :memory_store config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" } else config.action_controller.perform_caching = false config.cache_store = :null_store end config.action_mailer.raise_delivery_errors = false config.action_mailer.perform_caching = false config.active_support.deprecation = :log config.active_record.migration_error = :page_load config.assets.debug = true config.assets.quiet = true end
environments/production.rb
Rails.application.configure do config.cache_classes = true config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.read_encrypted_secrets = true config.public_file_server.enabled = true config.assets.js_compressor = :uglifier config.assets.css_compressor = :scss config.assets.compile = true config.assets.enabled = true config.log_level = :debug config.log_tags = [ :request_id ] config.action_mailer.perform_caching = false config.i18n.fallbacks = true config.active_support.deprecation = :notify config.log_formatter = ::Logger::Formatter.new if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end config.active_record.dump_schema_after_migration = false end
###試したこと
bundle exec rake tmp:pids:clear bundle exec rake tmp:sessions:clear bundle exec rake tmp:sockets:clear bundle exec rake tmp:cache:clear
ローカルでproductionでサーバを起動するとCSSは反映されています。
ご経験ある方、ご助言お願いします!
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/26 07:21
2017/07/26 07:27
2017/07/28 02:16
2017/07/28 02:19
2017/07/28 03:03
2017/07/28 08:05