asset-pipeline

assets:precompile fails with “File exists” on Rails 3.2.15 with Asset Pipeline

末鹿安然 提交于 2019-12-11 02:47:40
问题 I am unable to precompile my assets for my Rails 3.2.15 asset pipeline enabled app. Gemfile: # Asset pipeline group :assets do gem 'sass-rails', '3.2.5' gem 'coffee-rails', '3.2.2' gem 'uglifier', '1.3.0' end production.rb # 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 # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = false #

Rails - image.png Isn't Precompiled

老子叫甜甜 提交于 2019-12-10 23:44:19
问题 I'm attempting to deploy a web application on Amazon's EC2 servers, and I have the code up on the server. Everything looks like it's working, but when I go to the home page, I get a 500 error message and the production.log file gives me the following error: ActionView::Template::Error (image.png isn't precompiled) I've tried running rake assets:precompile , I've changed the line in config/environments/production.rb to config.assets.compile = true I've checked that the compiled image.png is in

404 not found error for assets in rails 4 production enviroment

狂风中的少年 提交于 2019-12-10 23:01:38
问题 I am new to rails from java enviroment. I have few confusions in asset pipeline with rails 3 to 4. Currently I am in rails 4.2.5 I created a sample app on my local environment. I created a new js from inside app/assets/javascripts and referencing it from the view , everything seems to working fine on my local environment. After this I thought to test with production env how it works. Here are the steps I did. RAILS_ENV=production rake assets:clean assets:precompile [All the files created

Asset Pipeline Pre-Compile all asset folder sub directories

旧时模样 提交于 2019-12-10 21:56:24
问题 I like to keep my assets highly organized, however, I am running into an issue with precompile. It is not picking up the sub directories. Here are the paths: assets >fonts >images >>backgrounds >>home >>icons Everything works on dev, but prod = no go. In my prod environment I already do: config.assets.enabled = true config.assets.compile = true config.assets.precompile += ['*.js', '*.ico', '*.png', '*.jpg'] config.assets.initialize_on_precompile = true And I am currently running the following

asset_host and relative protocol URLs being changed to http

橙三吉。 提交于 2019-12-10 20:55:39
问题 Certain elements of my application (Rails 4.0.0) are available through both http:// and https:// connections, so I have configured my asset_host to use a relative protocol url (//), which should allow the browser to switch to the protocol it wishes to source the assets from. config.action_controller.asset_host = "//assets%d.mydomain.com" This works very nicely throughout nearly all of my application, however I have a particular circumstance whereby Rails seems to output the host using http://

file.png isn't precompiled

…衆ロ難τιáo~ 提交于 2019-12-10 20:27:19
问题 I thought I had the assets pipeline figured out, but not any more. I have a stylesheet named clients.css.scss .client { .list_view { width: 650px; height: 500px; overflow: auto; table { width: 650px; border: solid 2px #999999; border-collapse: collapse; thead tr { background: image-url('list-view-header.png') repeat-x; } thead tr:first-child { background-image: none; } } } } Every time I try to precompile it in production I keep getting a "file.png isn't precompiled" error. bundle exec rake

Rails asset pipeline: How to prevent caching of a specific asset

别说谁变了你拦得住时间么 提交于 2019-12-10 19:18:18
问题 As stated in the title I want to prevent caching of a specific asset, namely a javascript file something.js.erb . The situation is like as follows: Content of something.js.erb : ... var something = <%= SomethingHelper.get_something.to_json %>; ... It binds the value from SomethingHelper successfully but only once and unless the javascript file is edited by hand the value of var something is never assigned again. This might be somehow expected but clearly doesn't meet my needs. Output of

Heroku can't find files in my Ruby on Rails app - even though they are right there?

强颜欢笑 提交于 2019-12-10 18:59:05
问题 When I try to access my site, then check my Heroku logs, I see this error: ActionView::Template::Error (couldn't find file 'reset' 2012-06-13T02:31:43+00:00 app[web.1]: (in /app/app/assets/stylesheets/application.css:4)): (application.css contains the line *= require reset) Then I thought to run "heroku run bundle exec rake assets:precompile:all" but this gives a similar error: -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! couldn't find file 'main

assets rails 3.1 not load after precompile nginx + unicorn

此生再无相见时 提交于 2019-12-10 18:33:47
问题 I am trying precompile assets in production env. But after precompile the app does not find the images files, javascripts files, css files...etc. I run this command: RAILS_ENV=production rake assets:precompile and I get this result: /home/hyperrjas/.rvm/rubies/ruby-1.9.2-p318/bin/ruby /home/hyperrjas/.rvm/gems/ruby-1.9.2-p318/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets /home/hyperrjas/.rvm/rubies/ruby-1.9.2-p318/bin/ruby /home/hyperrjas/.rvm/gems/ruby-1.9.2-p318

Get digested asset_path in model or controller

烂漫一生 提交于 2019-12-10 18:26:56
问题 I have an Article model, which has a field svg_path . I use fabricjs to draw a canvas that can contain multiple articles and is modifiable. What I do currently is generating a json that contains all needed fields of the articles, including the svg_path . When I try to use the asset_path helper (http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_path) in either my Article model or controller it will always just return the path without the digest, which