本地主机:3000将不会更新我的CSS,或者在关闭关闭后删除静态文件时完全不会加载

卡拉河

自从我对资产进行预编译以部署到Heroku以来,我一直在努力进行Rails项目。CSS不会更新,因此我遵循了其他类似条目的建议,并删除了静态文件。然后,该应用程序将永远不会加载,而只会处于缓冲状态。我还尝试将config.serve_static_files设置为false。清理完耙子资产后,我得到了相同的结果。我也尝试了dscacheutil -flushcache,以不起作用。

我的development.rb文件:

    Rails.application.configure do
      # Settings specified here will take precedence over those in config/application.rb.

      # In the development environment your application's code is reloaded on
      # every request. This slows down response time but is perfect for development
      # since you don't have to restart the web server when you make code changes.
      config.cache_classes = false

      # Do not eager load code on boot.
      config.eager_load = false

      # Show full error reports and disable caching.
      config.consider_all_requests_local       = true
      config.action_controller.perform_caching = false

      # Don't care if the mailer can't send.
      config.action_mailer.raise_delivery_errors = false

      # Print deprecation notices to the Rails logger.
      config.active_support.deprecation = :log

      # Raise an error on page load if there are pending migrations.
      config.active_record.migration_error = :page_load

      # Debug mode disables concatenation and preprocessing of assets.
      # This option may cause significant delays in view rendering with a large
      # number of complex assets.
      config.assets.debug = false
      config.serve_static_files = false

      # Asset digests allow you to set far-future HTTP expiration dates on all assets,
      # yet still be able to expire them through the digest params.
      config.assets.digest = true
      config.assets.compress = true
      # Adds additional error checking when serving assets at runtime.
      # Checks for improperly declared sprockets dependencies.
      # Raises helpful error messages.
      config.assets.raise_runtime_errors = false

      # Raises error for missing translations
      # config.action_view.raise_on_missing_translations = true
    end

以防万一我的production.rb文件:

    Rails.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

      # Eager load code on boot. This eager loads most of Rails and
      # your application in memory, allowing both threaded 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

      # 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 serving static files from the `/public` folder by default since
      # Apache or NGINX already handles this.
      config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

      # 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

      # Asset digests allow you to set far-future HTTP expiration dates on all assets,
      # yet still be able to expire them through the digest params.
      config.assets.digest = true

      # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

      # 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

      # Use the lowest log level to ensure availability of diagnostic information
      # when problems arise.
      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'

      # 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 cannot be found).
      config.i18n.fallbacks = true

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

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

      # Do not dump schema after migrations.
      config.active_record.dump_schema_after_migration = false
    end

请帮助我,我几乎无法做任何这样的工作。谢谢

和巴巴里托

你试过跑步rake assets:precompile吗?

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

ruby on rails不会加载欢迎页面(本地主机:3000)

来自分类Dev

Google Chrome浏览器在离线时不会加载本地主机网站

来自分类Dev

打开我的网站时,css文件不会加载

来自分类Dev

DNS区域文件将不会加载

来自分类Dev

关闭后,我的引导警报将不会显示

来自分类Dev

Travis-CI构建完全不会在请求请求时启动

来自分类Dev

CSS-完全不会裁剪的全屏背景图片

来自分类Dev

使用否定前瞻完全不会导致匹配

来自分类Dev

Lubuntu将不会加载

来自分类Dev

Lubuntu将不会加载

来自分类Dev

捆绑后将不会加载Aurelia骨架导航

来自分类Dev

打开和关闭Internet连接后,UIWebview不会加载页面

来自分类Dev

HTML不会加载外部CSS文件

来自分类Dev

Firefox不会加载CSS文件

来自分类Dev

PHP文件将不会加载ajax请求

来自分类Dev

在Django中更改STATIC_ROOT和STATICFILES_DIRS后不会加载静态文件

来自分类Dev

重新加载页面时,从 Angular 6 中的 url 中删除 # 后页面不会加载。

来自分类Dev

在Shinyapps.io上部署后,我的闪亮应用程序不会加载图像,但是在本地完全可以正常运行

来自分类Dev

Spring Boot Thymeleaf不会加载静态文件

来自分类Dev

dxSelectBox将不会加载数据

来自分类Dev

onSubmit按钮将不会加载位置

来自分类Dev

Bootstrap / Laravel将不会加载JavaScript

来自分类Dev

尝试从本地 JSON 文件调用图像时不会加载图像

来自分类Dev

CDN关闭时如何加载通用CSS文件的本地副本?

来自分类Dev

删除wamp中的临时文件会加快我的本地主机服务器的速度吗?

来自分类Dev

关闭输入流后,boost :: process :: child将不会退出

来自分类Dev

MDX-具有EXCEPT的计算成员完全不会汇总吗?

来自分类Dev

更新后不会加载管理员帐户

来自分类Dev

单击“x”或“关闭”后,我的引导模式不会关闭

Related 相关文章

  1. 1

    ruby on rails不会加载欢迎页面(本地主机:3000)

  2. 2

    Google Chrome浏览器在离线时不会加载本地主机网站

  3. 3

    打开我的网站时,css文件不会加载

  4. 4

    DNS区域文件将不会加载

  5. 5

    关闭后,我的引导警报将不会显示

  6. 6

    Travis-CI构建完全不会在请求请求时启动

  7. 7

    CSS-完全不会裁剪的全屏背景图片

  8. 8

    使用否定前瞻完全不会导致匹配

  9. 9

    Lubuntu将不会加载

  10. 10

    Lubuntu将不会加载

  11. 11

    捆绑后将不会加载Aurelia骨架导航

  12. 12

    打开和关闭Internet连接后,UIWebview不会加载页面

  13. 13

    HTML不会加载外部CSS文件

  14. 14

    Firefox不会加载CSS文件

  15. 15

    PHP文件将不会加载ajax请求

  16. 16

    在Django中更改STATIC_ROOT和STATICFILES_DIRS后不会加载静态文件

  17. 17

    重新加载页面时,从 Angular 6 中的 url 中删除 # 后页面不会加载。

  18. 18

    在Shinyapps.io上部署后,我的闪亮应用程序不会加载图像,但是在本地完全可以正常运行

  19. 19

    Spring Boot Thymeleaf不会加载静态文件

  20. 20

    dxSelectBox将不会加载数据

  21. 21

    onSubmit按钮将不会加载位置

  22. 22

    Bootstrap / Laravel将不会加载JavaScript

  23. 23

    尝试从本地 JSON 文件调用图像时不会加载图像

  24. 24

    CDN关闭时如何加载通用CSS文件的本地副本?

  25. 25

    删除wamp中的临时文件会加快我的本地主机服务器的速度吗?

  26. 26

    关闭输入流后,boost :: process :: child将不会退出

  27. 27

    MDX-具有EXCEPT的计算成员完全不会汇总吗?

  28. 28

    更新后不会加载管理员帐户

  29. 29

    单击“x”或“关闭”后,我的引导模式不会关闭

热门标签

归档