asset-pipeline

Why do assets fail to load in production mode?

ε祈祈猫儿з 提交于 2019-12-13 01:25:38
问题 Ruby Version: 2.0.0 Rails Version: 4.0.1 My application development has been going great, until I tried pushing to ninefold, where all of my assets broke. After seeing this I executed a rails server -e production and it also looks like everything breaks locally too. What about my production environment could be causing this? The log Marker - Apr 16, 2014, 7:59:26 PM I, [2014-04-16T19:59:27.178088 #2603] INFO -- : Started GET "/" for 127.0.0.1 at 2014-04-16 19:59:27 -0500 I, [2014-04-16T19:59

How can I reset my asset pipeline in Rails?

℡╲_俬逩灬. 提交于 2019-12-13 00:29:24
问题 Such a strange problem, but I deployed to production, and it won't update with my new CSS changes because of a caching issue. I tried this : bundle exec rake assets:precompile But that returns : rake aborted! Don't know how to build task 'assets:precompile' Ah, so I must be missing the sprockets in my application.rb perhaps. I tried everything on this link : How to build task 'assets:precompile' . And every solution caused a load error for not finding the items that it pointed out. What

Circular dependency error in SCSS file in Rails 3.1 asset pipeline

我们两清 提交于 2019-12-12 20:26:15
问题 I've got application.css.scss in my assets/stylesheets directory, along with a number of controller-specific scss files. The application.css.scss file has *= require_self *= require_tree . And I have some ordinary scss following these directives. When both require statements are enabled, I get "/app/assets/stylesheets/application.css.scss has already been required." (There is no application.css , I've double-checked.) Commenting out the *require_tree .* line eliminates the error, but

Why are ALL files included in Rails' asset pipeline?

丶灬走出姿态 提交于 2019-12-12 20:06:39
问题 Why are ALL JavaScript and CSS files included in the asset pipeline rather than the ones that are actually being used? For example, if I have a simple website with a home page and blog, why are the home page's JavaScript and CSS files included when a user is viewing the blog? Or vice versa, why are the blog's assets included when viewing the home page? 回答1: They all get compiled together and minified so the footprint is really small. Also once they are loaded once, they are cached so the rest

How to setup assets pipeline in rails 5 to use a custom font?

北慕城南 提交于 2019-12-12 15:25:51
问题 I have to use a custom font Jameel Noori Nastaleeq in a rails 5 app. I have never worked with assets pipeline in rails before. Here are some of the steps I have taken: create fonts folder in app/assets , and place the extracted ttf font file in it add config.assets.paths << Rails.root.join("app", "assets", "fonts") in config/application.rb add the following in app/assets/stylesheets/couplets.scss : @font-face { font-family: 'Jameel Noori Nastaleeq'; src:asset-url('JameelNooriNastaleeq.ttf')

“stack level too deep” while compiling assets

北慕城南 提交于 2019-12-12 11:24:21
问题 After running brew upgrade , or something else which updated my gems/ruby version, my rake assets:precompile task no longer works. I get this error: rake aborted! stack level too deep (in /Users/Jordan/Development/reejay/rails/reejay/app/assets/stylesheets/blog_player.css.scss) /Users/Jordan/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:162 Tasks: TOP => assets:precompile:primary rake aborted! Command failed with status (1): [/usr/local/Cellar/ruby/1.9.3-p0/bin/ruby /...] /usr

Rails 3.1 Use an image without fingerprint hash

懵懂的女人 提交于 2019-12-12 10:03:08
问题 I have solved a few of my asset pipeline woes, but one of them remains. I have a couple of image_tags, and I want them to refer to the non-fingerprinted/hashed/digested version. Is there a way to force an image_tag (but only one or two, not application-wide) to use the non-digested version of the image? 回答1: Take a look at fingerprintless, that should do it. 回答2: Use :digest => false as an option to asset_path within image_tag <%= image_tag(asset_path("filename.png", :digest => false)) %> 来源:

Why is assets:precompile so slow on Heroku?

若如初见. 提交于 2019-12-12 09:42:16
问题 My deployment set up is to have Heroku precompile assets. I want them precompiled so I can send them to a CDN (via asset_sync) and I want that done on Heroku so I don't have any compiled assets in my repo. I set that up using Heroku's guide and that had been working great. I added turbo-sprockets-rails3 for a speed boost. It had all been working fine and then stopped; I can't figure out why. Now when I deploy (without public/assets ) the assets:precompile Rake task times out on Heroku. To see

Rails assets don't get updated

陌路散爱 提交于 2019-12-12 09:35:44
问题 I have a Rails 3.1 app and for some reason when I change CSS, the changes don't show up. I did bundle exec rake assets:precompile and it helped once, but now I am stuck with the old CSS no matter what. 回答1: As your assets are now precompiled you need to clean them with the following bundle exec RAILS_ENV=development rake rails_group=assets assets:clean 回答2: You might want to try rake assets:clean and then rake assets:precompile 回答3: For my production environment I had to combine a few of the

UrlMappings to point a URL to an asset pipeline file in Grails

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:43:04
问题 In Grails 3.0 how do you map a URL to a file under the assets folder? For example: http://localhost:8080/favicon.ico --> grails-app/assets/images/bookmark.ico I've tried a few test mappings, such as: grails-app/controllers/UrlMappings.groovy class UrlMappings { static mappings = { ... "/t1.png" (uri: "/assets/images/test.png") "/t2.png" (uri: "/assets/test.png") "/t3.png" (uri: "/images/test.png") "/t4.png" (dir: "assets/images", file: "test.png") ... } } ...but they all result in a 500