简体   繁体   English

运行rake资产后的数据表未在生产模式下显示:预编译。 导轨3.2

[英]Datatables not showing in production mode after running rake assets:precompile. rails 3.2

When i run my application in development my datatables table is showing but when i run my app in production datatables is not showing. 当我在开发运行我的应用我的DataTable表显示,但是当我在生产运行数据表我的应用程序没有显示。 only the records ar shown. 仅显示记录ar。

screenshot in developemnt: 屏幕截图:

数据表显示

screenshot in production: 生产中的屏幕截图:

数据表丢失

My production.rb: 我的production.rb:

Contractbeheerpj::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 = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

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

  # Defaults to nil and saved in location specified by config.assets.prefix
  # 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

Hope someone can help! 希望有人能帮忙! :) :)

Your issue is probably because of Rails Asset pipelining which Rails in production precompiles your js files to public/assets hence your js file is either not loaded or is an older version. 您的问题可能是由于Rails资产流水线,生产中的哪个Rails将您的js文件预先编译为公共/资产,因此您的js文件未加载或版本较旧。 Look at this answer to a similar issue to what you are having. 查看这个答案 ,以解决与您所遇到的类似问题。

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

相关问题 Rails rake资产:用于生产的预编译 - Rails rake assets:precompile for production Rails 3.2 - 资产预编译,但不在Apache生产模式下显示 - Rails 3.2 - assets precompile, but not display in production mode with Apache Rails 3.2耙资产:预编译错误 - Rails 3.2 rake assets:precompile error 生产中的 rails 6 webpacker:rake 资产:预编译失败 - rails 6 webpacker in production: rake assets:precompile fails Rails - 我可以运行rake资产:在生产服务器上预编译,而生产应用程序仍在运行吗? - Rails - Can I run rake assets:precompile on production server, while the production app is still running? 无法运行rake资产:在rails中预编译 - can't running rake assets:precompile in rails Rails 5- RAILS_ENV =生产耙资产:预编译与耙资产:预编译之间的差异 - Rails 5- Difference between RAILS_ENV=production rake assets:precompile and rake assets:precompile Rails Assets在生产模式下预编译错误 - Rails Assets Precompile in production mode error rake assets:precompile 和 RAILS_ENV=production rake assets:precompile 有什么区别? - what's the differences between rake assets:precompile and RAILS_ENV=production rake assets:precompile? 即使在运行rake资产后,也会产生生产错误“未预编译application.css”:预编译没有错误 - Production error “application.css isn't precompiled” even after running rake assets:precompile without errors
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM