1.environment/production.rb
Zyt::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true #是否起用静态文件,如果为false,目前我所测试的项目缓存起不了很大做用。(默认值为false)
# Compress JavaScripts and CSS
config.assets.compree=true #如果是jquery框架,并且样式与js都在assets下(默认值为false)
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = false #生产环境中,上传图片显示(默认值为true)
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# 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
# See everything in the log (default is :info)
# config.log_level = :debug
# 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 are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# 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
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
end
分享到:
相关推荐
《Rails之道》按照Rails的各个子系统进行组织编排,分别介绍了Rails的环境、初始过程、配置和日志记录,Rails的分配器、控制器、页面生成和路由,REST、资源和Rails,ActiveRecord的基础、关联、验证和高级技巧,...
Ruby on rails推荐的生产运行环境是Linux/FreeBSD/Unix。本文以Linux操作系统,lighttpd+FCGI,MySQL数据库为例,从源代码编译安装开始讲解。
15.3 Rails配置 195 15.4 命名约定 197 15.5 Rails的日志 200 15.6 调试信息 200 15.7 精彩预告 202 第16章 Active Support 203 16.1 通用扩展 203 16.2 枚举和数组 204 16.3 Hash 205 16.4 字符串扩展 206 16.5 ...
Ruby 2.1.5 + Rails 4.2 - 配置文件中定义的版本 环境 Postgres 9.3 用于生产的 Nginx + Phusion 乘客 节点.js 邮差 很酷的开发工具:oh-my-zsh、htop、tig 版本 1.0 如何 安装 Vagrant 和 Ansible 在目录中运行...
log 本示例是一个基于Rails的简单Blog 目录结构 ├── app ├── app.json ...生产环境可根据需求使用mysql pg 本地运行 ruby 2.2.1 rails 4.2.1 请确认您的环境安装了 , git clone https://github
安装和配置将下一行添加到应用程序的 Gemfile 中: gem 'rails_ui_kit' , group : :development 注意:如果您想在临时或生产环境中使用 gem 功能,请不要忘记在必要时限制对/ui资源的访问。 然后执行: $ bundle在...
当您在生产环境中运行应用程序时,它限制了各种rake任务的使用(包括db:drop,db:reset等)。 安装 要安装,只需将其添加到您的Gemfile并运行bundle 。 gem 'rails_safe_tasks' , '~> 1.0' 用法 您无需执行任何...
生产准备的Rails 4和Heroku的模板 该模板包含以下内容: Ruby 2.2.0 萨斯具有可变自定义设置的引导程序咖啡脚本苗条的Postgres 独角兽费加罗用于 Heroku 的 rails_12factor安装 git 克隆 git@github....
Komponent基于组件在Ruby on Rails中实现了一种合理的组织前端代码的方式。 :waving_hand: 小心! 目前这种宝石的未来。...国际化可用的语言环境配置 时尚指南 配置 更改默认的根路径 生成器的默认选项 更改默认样式表
马古罗 Maguro 是使用的基本 Rails 应用程序。 它的目标是自动为您完成设置新项目的所有无聊配置,因此您可以在几秒钟而不是几小时内进入有趣的开发部分。 模板有什么作用?...为暂存和生产环境创建 Heroku 应用
它能通过FLASK_ENV环境变量自动选择开发环境配置或生产环境配置。使用之前要先安装:复制代码 代码如下:$ sudo pip install Flask-Environments然后修改config.py,将公用配置和默认配置写入Config类,针对环境的...
但实质上,此框架的主要目的是提供一种快速安全地向生产环境交付新功能的方法。安装捆绑到您的Rails应用程序中。产品特点隔离引擎Motorhead可帮助您将特殊折痕的隔离式发动机安装到主Rails应用程序上。 引擎可以...
它创建用于部署到生产的开发环境和脚本。 此存储库基于 。 安装 安装和。 运行./scripts/init_development.sh来创建开发环境。 运行fig up以启动 rails web 服务器。 在 Web 浏览器中打开...
只需将它用于开发和预生产环境,它不会弄乱或破坏您的生产应用程序或测试,但会减轻您和您的测试人员的日常生活。ActionMailer 版本这个插件现在与ActionMailer的补丁版本一起工作,它使用mail gem 而不是tmail 。 ...
Schienenzeppelin为您提供了现成的Rails应用程序,您可以在几分钟内将其投入生产。 它预先配置了一些gems和实用程序-尽管是一种标准-但默认Rails应用程序生成器中未包含它们。 一些重点包括: 使用和移动友好型主页...
借助RVM,您可以在开发、配置项、问答、试运行和生产环境中拥有**完全相同的* *独立环境。不再有隐藏的陷阱:如果它适用于其中一个,它将适用于所有的。使用命名的gemsets,您可以可靠地立即将更改从一个环境推送到另...
环境 从配置目录通过 HTTP 提供应用程序环境变量。 概述 最初的想法是从网络中获取.env文件的应用程序环境变量。 文件对于本地开发和生产部署非常有用...使用 curl 请求 myapp 的生产环境: curl http://localhost:3
要在生产环境中使用电子邮件通知,您需要定义以下内容: SMTP_SERVER SMTP_SERVER_PORT EMAIL_DOMAIN_NAME AUTH_TYPE SMTP_USERNAME SMTP_PASSWORD TLS_AUTO DEFAULT_SENDER 使用 GMail 的 SMTP 配置示例 SMTP_...
简单的项目配置,自动Ruby Gems的管理,耙支持 - 它有一切一个Ruby开发人员需要在开发环境中。 在Rails使用Ruby RubyMine带来了专用RoR的项目结构的意见,快速模型 - 视图 - 控制器导航选项,Rails特定代码完成,...