I'm with a trouble, I have a application and some views use javascripts, I'm using the jammit gem.
I add a new javascript to sort and to filter records, the problem is, works in development, but doens't work in production.
I tried some things, for example, if a change this line:
config.serve_static_assets = false
for
config.serve_static_assets = true
works, but I don't do this just for a javascript works, because already exists others javascripts in app.
Other test, I copied the line in assets/datatables.js in cut in public/javascripts/datatables.js, in development works and in production doesn't.
Gemfile
gem 'jammit'
config/assets.yml
...
package_assets: on
compress_assets: on
embed_assets: off
javascripts:
common:
- public/javascripts/jquery.js
- public/javascripts/jquery-ui.js
- public/javascripts/jquery_ujs.js
...
datatables:
- public/javascripts/jquery.dataTables.min.js
enviroments/production.rb
...
config.serve_static_assets = false
...
views/user_reports/index.html.erb
<%= include_javascripts :datatables %>
I don't any idea =/
PS: Sorry for english
UPDATED 01
Log:
rake assets:precompile --trace RAILS_ENV=production
/usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.5.3/lib/bundler.rb:295: warning: Insecure world writable dir /usr/local in PATH, mode 040777
rake aborted!
Don't know how to build task 'assets:precompile'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/task_manager.rb:49:in `[]'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:115:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/bin/rake:23:in `<main>'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-1.9.2-p290@base2_crowdtest/bin/ruby_executable_hooks:15:in `<main>'