in production I'm getting this error:

ActionView::Template::Error (vendor/jquery_extras.js isn't precompiled):
    26: = stylesheet_link_tag "application", media: "all"
    27: = javascript_include_tag "application"
    28: 
    29: = javascript_include_tag "vendor/jquery_extras"
    30: = javascript_include_tag "vendor/jquery.ba-bbq"
    31: = javascript_include_tag "vendor/moment-with-langs"
    32: = javascript_include_tag "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"
  app/views/layouts/_headers.html.haml:29:in `_app_views_layouts__headers_html_haml__4249496561736037731_30585640'
  app/views/layouts/application.html.haml:12:in `_app_views_layouts_application_html_haml__4179352970330185641_30563940'
  app/controllers/items_controller.rb:82:in `new'

in my config/environments/production.rb I have:

# 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
  config.assets.compress = false

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

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

  # list of assets that need precompilation in vendor directory
  config.assets.precompile += %w( vendor/jquery_extras.js vendor/jquery.ba-bbq.min.js vendor/moment-with-langs.min.js )

and in my public/assets/ I have :

$ ls -1 jquery_extras* jquery.ba-bbq* moment-with-langs*
jquery.ba-bbq.min-ad74c9887b7231076917be90512e14c4.js
jquery.ba-bbq.min-ad74c9887b7231076917be90512e14c4.js.gz
jquery.ba-bbq.min.js
jquery.ba-bbq.min.js.gz
jquery_extras-7eb0ce2de6f2553ef84968dc07cec831.js
jquery_extras-7eb0ce2de6f2553ef84968dc07cec831.js.gz
jquery_extras.js
jquery_extras.js.gz
moment-with-langs.min-c30ecb28ae71b4d324d710136a628b14.js
moment-with-langs.min-c30ecb28ae71b4d324d710136a628b14.js.gz
moment-with-langs.min.js
moment-with-langs.min.js.gz

in my vendor/assets directory I have:

$ ls -1 vendor/assets/
fonts
images
img
javascripts
stylesheets

and:

$ ls -1 vendor/assets/javascripts/
jquery.ba-bbq.min.js
jquery_extras.js
moment-with-langs.min.js

here's my application.js

//= require jquery
//= require jquery_ujs
//= require arwa
//= require jquery.ui.datepicker
//= require jquery.timepicker
//= require colorbox-rails
//= require twitter/bootstrap
//= require cocoon
//= require arwa
//= require_tree .

I'm not sure what I'm doing wrong. could you please help me?

thanks

有帮助吗?

解决方案

Compare with Assets precompile Guide I found this:

in your config/enviroments/production.rb

config.assets.compress = false

in the guide it is:

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

# Choose the compressors to use
# config.assets.js_compressor  = :uglifier
# config.assets.css_compressor = :yui

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

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

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )

If you are doing local compilation, look up here for do it and after that run local compilation $ RAILS_ENV=production bundle exec rake assets:precompile

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top