当Rails 4

时间:2016-01-09 19:57:24

标签: ruby-on-rails-4 sass asset-pipeline

我正在尝试在我的Rails 4.2.5开发环境中更改任何CSS设置时解决绝对荒谬的视图刷新延迟。

唯一真正有效的是在我的development.rb中更改此设置,正如几个网络资源推荐的那样:

config.assets.debug = false

这可能会加快速度,而且肯定会(简单重新加载90秒对10秒),但现在我应用于CSS样式表的任何更改都会被忽略。我必须恢复到config.assets.debug = true并重启我的服务器才能看到任何CSS更改。

这是正常的吗?

我发现由于这种视图刷新延迟问题,在rails中开发变得越来越令人沮丧。

这些是我的development.rb文件的内容:

Rails.application.configure do
  config.action_mailer.default_url_options = { host: '$IP', port: $PORT }
  # Settings specified here will take precedence over those in config/application.rb.
  require 'carrierwave/orm/activerecord'
  #to be able to render console in cloud9
  config.web_console.whitelisted_ips = '0.0.0.0/0.0.0.0'
  # 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 = true

  config.action_mailer.smtp_settings ={
    :user_name => ENV['SENDGRIDUSERNAME'],
    :password => ENV['SENDGRIDPASSWORD'],
    :domain => 'deseocumplido.pe',
    :address => 'smtp.sendgrid.net',
    :port => 2525,
    :authentication => :plain,
    :enable_starttls_auto => true
  }

  # 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

  # 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

  # Adds additional error checking when serving assets at runtime.
  # Checks for improperly declared sprockets dependencies.
  # Raises helpful error messages.
  config.assets.raise_runtime_errors = true

  #lets serve images outside public folder (example tmp images when uploading)
  config.serve_static_files = true
  # Raises error for missing translations
  # config.action_view.raise_on_missing_translations = true
end

任何帮助将不胜感激

0 个答案:

没有答案