Problems with Datatable Production environment - Linux / Apache
Problems with Datatable Production environment - Linux / Apache
Good morning
Somedays I'm trying to run a rails application with datatable on the production environment.
The server is a debian with rvm, ruby 1.9.3, rails 3.2.6 and apache installed.
The main application runs fine but the component referring to the datatable is totally ignored.
It does not show the datatables and in the source code of the page you can verify that it is not loading any files: "* js.coffee" which belongs to the folder "assets".
The awkward thing regards to a different component connected to javascript / jquery that works properly in the same application.
Only the datatable component that is not loading.
Is the datatable component compatible with Apache, ruby 1.9.3 and rails 3.2.6?
Or
In the production environment (linux) need a different configuration than the test environment (windows)?
I list Below some files that may help in this verification.
Thank you for any help.
application.js
//= require jquery
//= require jquery-ui
//= require dataTables/jquery.dataTables
//= require_tree .
application.css
*= require_self
*= require dataTables/jquery.dataTables
*= require_tree .
*/
application.rb
class Application < Rails::Application
config.i18n.available_locales = [:en, :"pt-BR"]
config.i18n.default_locale = :"pt-BR"
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
production.rb
App::Application.configure do
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# 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
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# 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
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
config.action_dispatch.x_sendfile_header = "X-Sendfile"
end
Somedays I'm trying to run a rails application with datatable on the production environment.
The server is a debian with rvm, ruby 1.9.3, rails 3.2.6 and apache installed.
The main application runs fine but the component referring to the datatable is totally ignored.
It does not show the datatables and in the source code of the page you can verify that it is not loading any files: "* js.coffee" which belongs to the folder "assets".
The awkward thing regards to a different component connected to javascript / jquery that works properly in the same application.
Only the datatable component that is not loading.
Is the datatable component compatible with Apache, ruby 1.9.3 and rails 3.2.6?
Or
In the production environment (linux) need a different configuration than the test environment (windows)?
I list Below some files that may help in this verification.
Thank you for any help.
application.js
//= require jquery
//= require jquery-ui
//= require dataTables/jquery.dataTables
//= require_tree .
application.css
*= require_self
*= require dataTables/jquery.dataTables
*= require_tree .
*/
application.rb
class Application < Rails::Application
config.i18n.available_locales = [:en, :"pt-BR"]
config.i18n.default_locale = :"pt-BR"
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
production.rb
App::Application.configure do
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# 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
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# 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
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
config.action_dispatch.x_sendfile_header = "X-Sendfile"
end
This discussion has been closed.
Replies
All DataTables needs is an HTTP server, which Apache more certain does.
Allan
I'm really not sure what the root of the problem you're encountering. I think it's related to how rails handles assets.