- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
更新:我刚刚发现,只有当我 push 生产时,我的 Assets 才会出现在暂存中。
每当我添加新的图像 Assets 、预编译它们并部署到暂存区时,它们都不会出现。但是,一切都在本地和生产环境中运行。这是我的代码和添加新图像 Assets 时的过程。任何帮助,将不胜感激。我对此很陌生,一直在到处寻找答案。
staging.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.action_mailer.default_url_options = { :host => 'http://site_name.herokuapp.com' }
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.log_level = :debug
config.action_controller.asset_host = Proc.new { |source|
if source =~ /\b(.png|.jpg|.gif|.svg)\b/i
"http://key.cloudfront.net"
end
}
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
end
我如何为暂存预编译我的 Assets
RAILS_ENV=staging bundle exec rake assets:precompile
我如何为生产预编译我的 Assets
RAILS_ENV=staging bundle exec rake assets:precompile
application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module InfoSite
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
config.serve_static_files = true
config.assets.compile = true
config.assets.configure do |env|
if Rails.env.development? || Rails.env.test?
env.cache = ActiveSupport::Cache.lookup_store(:memory_store)
end
end
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*. {rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end
我添加图像 Assets 的过程:
RAILS_ENV=staging bundle exec rake assets:precompile
RAILS_ENV=production bundle exec rake assets:precompile
现在,如果我查看暂存, Assets 会返回一个显示图像名称的空图像框。
我的流程中是否遗漏了什么?我应该对此采取不同的方法吗?
最佳答案
转到 config/application.rb。查找字符串 config.assets.enabled
并将值设置为“true”。或者 config.assets.initialize_on_precompile
并设置为 true。
关于ruby-on-rails - Heroku 暂存站点上未显示新图像 Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31554262/
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 3年前关闭。 Improve this questi
我正在寻找有关自动文件夹同步工具的建议,以保持我们三个环境中的内容自动同步。 具体来说,我们有几个应用程序,用户可以在其中上传内容(通过文件上传页面或类似机制),例如图像、pdf 文件、word 文档
我是 Azure 新手,我正在开发一个使用新网站模型而不是云服务的项目。我想建立一个像这样的持续交付流程:http://www.windowsazure.com/en-us/develop/net/c
我正在寻找这两者在 GPU 读取速度和偶尔 CPU 写入(每帧少于一次,甚至只有一次)方面的区别。我不想使用 D3D11_USAGE_DYNAMIC,因为数据不会更新 >= 每帧一次。 Default
我有一个网站 www.livesite.com 目前正在运行。我一直在用 http://localhost 在本地机器上开发网站的新版本然后使用 svn 将我的更改提交到 www.testsite.c
我正在尝试创建一个在开发环境(将计算机用作本地主机)、暂存环境(服务器上的特定端点)和生产环境(另一个特定服务器端点)中工作的 Xcode 项目。我找到了一些关于如何设置它的不同教程。一些解决方案建议
在我过去和现在的 Web 开发职位中,Staging/Beta 和 Production/Stable 环境共享一个数据库。 这是我对正在发生的事情的理解: Staging/Beta 基本上与 Pr
在 WebsiteAzure 中,我们有一个暂存功能。因此,我们可以部署到一个暂存站点,对其进行测试,填充所有缓存,然后使用暂存站点切换生产。 现在如何在带有 IIS 的普通 Windows 服务器上
昨天,当我们尝试更换我们的舞台制作角色时,遇到了可怕的问题/经历。 这是我们的设置: 我们有一个工作角色从队列中获取消息。这些消息在角色上进行处理。 (表存储插入、数据库选择等)。每个队列消息可能需要
我的 Eclipse 中有一个新的 Git 项目,Staging View 的 Unstaged Changes 面板不仅显示了我正在处理的文件,还显示了 .classpath 和 .project,
这就是我想要做的:在我的工作中,我们目前有多个环境可以工作。我们有多个开发环境,一个用于暂存(我们称之为“预生产”),以及我们的生产实例。我们已经开始在 Vue 中为我们的前端工作,并使用 webpa
假设我在一个文件夹中启动了一个 git 存储库,其中有几个子目录。 我有几个 globbing 模式 .gitignore 来排除子目录中的文件。但是,当我执行 git status 在我暂存任何内容
显然这是一个常见问题:我们有由 git 或其他 SCM 管理的 PHP Web 应用程序,并且(理想情况下)部署在 3 个以上应该极其相似的不同环境中。唯一的区别应该是在特定的配置上,例如外部资源的寻
如何在 Xamarin Forms 应用程序中设置不同的环境? (制作、演出、开发) 目前,我在代码中使用 #if DEBUG 来区分开发过程中使用的代码部分。那么有没有更好的方法来区分不同的环境呢?
如何在 Xamarin Forms 应用程序中设置不同的环境? (制作、演出、开发) 目前,我在代码中使用 #if DEBUG 来区分开发过程中使用的代码部分。那么有没有更好的方法来区分不同的环境呢?
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 4 个月前。 社区在 4
我创建了一个文件,然后使用 git add 将其暂存到我的 git 存储库中. 我还想在同一个提交中删除一些文件,所以做了一个 git rm -f 'files.*' . 我在删除行中使用的通配符有
有没有办法找到我设置为“假设未更改”的文件? 我已经修改了几个文件并想 pull ,所以我将它们设置为“假定不变”。现在我已经完成并想要提交,但是它们没有出现在 Git Staging 窗口中。 我使
我希望使用 Xcode 的方案来确定要针对哪个服务器运行我的应用程序。我有一个从服务器获取信息的应用程序。像大多数人一样,我有一个开发服务器、一个临时服务器和一个生产服务器。 我希望为其中的每一个创建
我希望 merge 一个允许我执行以下操作的 Web 开发工作流程: 在本地开发/测试 模拟生产服务器(许多子域,一些 mysql 数据库) 在台式机和笔记本电脑之间保持同步,以实现移动开发 轻松推送
我是一名优秀的程序员,十分优秀!