简体   繁体   English

Rails项目在生产中显示开发样式错误

[英]Rails project display development style errors in production

I will deployed rails project to production mode 我将Rails项目部署到生产模式

and then rails error showing develoment style 然后显示开发风格的错误

I change production.rb file some lines 我将production.rb文件更改为几行

but I dont remember what change sour code 但我不记得是什么改变了酸味代码

after chagne source code showing error page development error style page chagne源代码后显示错误页面开发错误样式页面

I dont know why not showing 404 Or 500 error page 我不知道为什么不显示404或500错误页面

this is my product.rb file content 这是我的product.rb文件内容

# -*- encoding : utf-8 -*-
Priday::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = false

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both thread web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = false

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Enable Rack::Cache to put a simple HTTP cache in front of your application
  # Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
  # config.action_dispatch.rack_cache = true

  # Disable Rails's static asset server (Apache or nginx will already do this).
  config.serve_static_assets = false

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = false

  # Generate digests for assets URLs.
  config.assets.digest = true

  # Version of your assets, change this if you want to expire all your assets.
  config.assets.version = '1.0'

  # Specifies the header that your server uses for sending files.
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # Set to :debug to see everything in the log.
  config.log_level = :info

  # Prepend all log lines with the following tags.
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups.
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets.
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
  # config.assets.precompile += %w( search.js )

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Disable automatic flushing of the log to improve performance.
  # config.autoflush_log = false

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new

end

help me 帮我

Update following lines: 更新以下行:

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both thread web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails项目:路线给生产带来500个错误,但在开发中起作用 - Rails project: routes give 500 errors in production but work in development Rails:生产与开发中的错误 - Rails: errors in production vs development Rails 3 - 生产模式中的开发错误 - Rails 3 - development errors in production mode 在安装SSL后,在生产模式中显示Rails开发样式错误 - Rails development-style errors showing in production mode after SSL installation Unicorn,Nginx在生产中出现Rails开发错误 - Rails development errors in production with Unicorn,Nginx Rails项目中的Jquery在生产中不起作用,但是在开发中 - Jquery in Rails project not working in production, but is working in development 是否可以使用Compass in rails为开发和生产设置不同的SASS输出样式? - Is it possible to set different SASS output style for development and production with Compass in rails? 如何像在开发模式中那样在生产中显示已加载的CSS / JS Rails资产? - How to display loaded CSS/JS Rails assets in production as is in development mode? 用于开发和生产的Rails初始化程序 - Rails initializer for development and production 在生产模式中遇到“开发”错误 - Getting “development” errors in production mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM