0

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>'
Lorena Bento
  • 544
  • 10
  • 29
  • I get an error when a I try: rake assets:precompile RAILS_ENV=production, the error is: rake aborted! Don't know how to build task 'assets:precompile' – Lorena Bento Jun 12 '14 at 13:09
  • there was no asset precompilation (via the asset pipeline and `assets:precompile`) in rails 3.0, which is why you get that error. – sevenseacat Jun 12 '14 at 14:20
  • Are you compiling the assets for production? At some point during the deploy you want to run the `jammit` command. – numbers1311407 Jun 12 '14 at 14:22
  • Well, I'm following this article: http://www.ruby-on-rails-outsourcing.com/articles/2011/07/21/using-jammit-in-rails/, after 'rails s -e production', in assets folder, show(? I don't know how to express this) a file, 'datatables.js', so, I guess its ok – Lorena Bento Jun 12 '14 at 14:31

0 Answers0