asset-pipeline

Tried several fixes: Heroku/Rails 4 Assets Precompile Error

跟風遠走 提交于 2019-12-05 04:39:37
Looks like this is a common issue, so let me begin by saying I've done a lot of research already. Following this thread, I ran heroku labs:enable user-env-compile -a myapp Then I made sure that assets precompile locally by running RAILS_ENV=production bundle exec rake assets:precompile They do. I also followed this tip, setting config.assets.initialize_on_precompile = false in my config/production.rb and config/application.rb. Also, following this issue, I've made sure I have the heroku gems installed: gem 'rails_log_stdout', github: 'heroku/rails_log_stdout' gem 'rails3_serve_static_assets',

Zurb Foundation 5, modernizr not found

徘徊边缘 提交于 2019-12-05 03:28:35
I get this when using Foundation 5.0.2.0 in production mode. On Rails, Unicorn, NginX & Ubuntu. "NetworkError: 404 Not Found - http://mydomain.com/javascripts/vendor/modernizr.js" Update 3/13/14 I don't have this problem on heroku with foundation-rails-5.1.1.0 . Adding javascript_include_tag "vendor/modernizr" in the head works. I could remove the modernizr I copied to the vendor directory and remove the extra line in app.js I had the same problem on heroku, the app would crash because it couldn't find modernizr.js. Here's how I fixed it: Copy modernizr.js from foundation (wherever you

Turbolinks and Controller-specific assets

こ雲淡風輕ζ 提交于 2019-12-05 03:01:11
I've modified application.html.erb to use controller specific assets: application.html.erb : <!DOCTYPE html> <html> <head> <title>My Application</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= stylesheet_link_tag params[:controller], 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= javascript_include_tag params[:controller], 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> </head> <body> ... other html template ... The problem is that, I have turbolinks installed. When

Selective Rails 3.2 asset pipeline compression per file

拟墨画扇 提交于 2019-12-05 02:24:30
问题 I'd like to selectively compress some of the javascript files in a Rails 3.2 app, but still have all js assets served from a single bundled file in the production environment. Syntax like this, inside of the app/assets/javascripts/application.js file, using the made-up :compress => false option passed to the last 3 sprockets require directives I hope explains what I'm trying to achieve. // Contents of app/assets/javascripts/application.js // //= require jquery //= require jquery_ujs //=

Javascript manifest file “application.js” is not processed

旧街凉风 提交于 2019-12-05 02:20:56
I am on a Macbook Pro and I created a new Rails 3.2 app, but the assets pipeline does not work. Here is what I did: $ rails version Rails 3.2.5 $ rails new test_assets $ cd test_assets $ rails server The server is started OK, but if I visit http://0.0.0.0:3000/assets/application.js , it turns out the manifest file is not processed at all, it shows: //... some comments ... //= require jquery //= require jquery_ujs //= require_tree . ; I tried to do the exactly the same steps on my other Macbook Pro. It works well. Visiting http://0.0.0.0:3000/assets/application.js on that machine shows a

Asset Precompilation OK, but 404 when trying to get files

风流意气都作罢 提交于 2019-12-05 02:12:25
Ok so compiling my assets is working fine but when I run: thin start -e production none of my javascript or css is loading. My browser is also cancelling the requests to get my assets. I'm not sure why this is but I suspect its because it thinks its 404'ing on them. If you look at the top image you'll see that my application.css file was compiled and stored in my assets folder but when I try to access the file, I'm getting my 404.html file. What gives!? Edit: I was asked to post my view. Here is some of the code in the project: <% content_for :title, 'Quick Quote' %> <% content_for :subtotal,

How to use Sprockets 2 with Rails 3.0.x (how to use precompiled assets)

天涯浪子 提交于 2019-12-05 02:03:51
问题 I'm trying to replicate the basics of the asset pipeline introduced in rails 3.1 in my rails 3.0 app . So far, I've got something like this: https://gist.github.com/1112393. It works great: I have my assets in app/assets/, lib/assets, vendor/assets... They're all served at /assets I can use everything sprockets 2 offers etc... The thing is, I don't want the rails app to serve static assets. The server should do it. That's why you can precompile assets in rails 3.1, if I understood correctly.

What is the best place to store static assets (files) in rails 3.1 ( pdf forms, xls files, etc)

孤街浪徒 提交于 2019-12-05 01:39:16
I have a bunch of static assets ( not jpg, css, & js) - rather files like pdf forms, xls that I need to serve to users. They rarely change. Before I used to store them in public folder, but with the introduction of the assets pipeline in rails 3.1 what is the best place to store files like that now now? thanks Actually I just tested it by creating a folder in app/assets/files and sticking my xls files in there, and rake assets:precompile task just picked it up. Also this needs to be added for Rails < 3.1: # Enable the asset pipeline config.assets.enabled = true config.assets.paths << "#{Rails

JS files double-included in rails app

孤街醉人 提交于 2019-12-05 01:38:31
I've got several rails 3.1 apps, and I'm having this problem in all of them. I have a bunch of js files that get included in my application.js file. Here's my application.js: //= require jquery //= require jquery-ui //= require jquery_ujs //= require_self //= require_tree . The problem is that when, development.rb, I have config.assets.debug set to true, all of my javascript files get double-included in the header. Actually, they are not explicitly double-included, but rather they are included once individually and once as part of a compiled application.js file. The js include tags look like

Rails Minified (Compiled) Assets in development mode

北战南征 提交于 2019-12-05 01:36:38
How do I get my assets rendered in their minified (compiled) form in Rails development mode? I have about few dozens of asset files, and because they are served one after another it all takes pretty long before the page loads in development. I believe if I keep them compiled and getting served from that would speed up my page load time(I know this is not ideal when I am specifically working on assets). Here is my style and script tags in the layout <%= stylesheet_link_tag 'all' %> <%= javascript_include_tag 'all' %> And I've also ran bundle exec rake assets:precompile:nondigest But I still see