asset-pipeline

Rails is precompile assets after deploy - Amazon EC2

北慕城南 提交于 2020-07-11 04:04:12
问题 Sometimes my EC2 server is down. I never figured out the reason. But these days after some deployments actions, the server is down. And is down after the deploy. I have a lot of assets to precompile and the deploy takes too long. I went to the monitoring areas on EC2 dashboard and the: CPU usage (Instance) Latency (ELB) Network In/Out (Instance) Is with higher values. See the prints: Then, I installed a gem Capistrano Faster Assets, to avoid capistrano precompile assets that is not modified.

Rails 5 Assets Not Loading in Production

心不动则不痛 提交于 2020-06-25 04:14:13
问题 I recently updated a few packages in my Rails application and now my assets aren't being served. Instead, I get the following error: Failed to load resource: the server responded with a status of 404 (Not Found) My assets are precompiled: assets.rb # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Add additional assets to the asset load path # Rails

Rails 4 and Leaflet: assets/images not found?

天涯浪子 提交于 2020-05-10 04:38:07
问题 I am having a problem that really should not be a problem. For some reason the images I have in app/assets/images are not accessable. When I request them I just get a 404. ./log/development.log:Started GET "/assets/images/marker-shadow.png" for 127.0.0.1 at 2013-07-20 22:02:38 -0400 ./log/development.log:ActionController::RoutingError (No route matches [GET] "/assets/images/marker-shadow.png"): mike@sleepycat:~/projects/myapp$ ls app/assets/images/ marker-icon-2x.png marker-icon.png marker

Rails 4 and Leaflet: assets/images not found?

只谈情不闲聊 提交于 2020-05-10 04:38:04
问题 I am having a problem that really should not be a problem. For some reason the images I have in app/assets/images are not accessable. When I request them I just get a 404. ./log/development.log:Started GET "/assets/images/marker-shadow.png" for 127.0.0.1 at 2013-07-20 22:02:38 -0400 ./log/development.log:ActionController::RoutingError (No route matches [GET] "/assets/images/marker-shadow.png"): mike@sleepycat:~/projects/myapp$ ls app/assets/images/ marker-icon-2x.png marker-icon.png marker

Rails - absolute URL for images in assets path for heroku

感情迁移 提交于 2020-03-28 06:59:38
问题 I am having images under app/assets/images/admin directory. In development I've used something like this to get the URL "#{root_url}assets/admin/filename.jpg" But its not working on Heroku. So what is the best way to reference images under assets folder on Heroku? 回答1: reference images under assets folder If you're using image_tag, you'll be able to call the relative path regardless of whether you're in production or development : <%= image_tag "admin/filename.jpg" %> -- If you're calling the

My Rails Javascript manifest file neither compiles nor include any required files

和自甴很熟 提交于 2020-02-13 09:19:20
问题 I've seen a few posts similar to this but with no solutions, so I figured I would present a more documented problem. My Problem JS from manifest file is not including or compiling any JS. When running my server locally, and opening the JS file I see nothing compiled, just the standard application.js manifest file : // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib

My Rails Javascript manifest file neither compiles nor include any required files

爷,独闯天下 提交于 2020-02-13 09:19:14
问题 I've seen a few posts similar to this but with no solutions, so I figured I would present a more documented problem. My Problem JS from manifest file is not including or compiling any JS. When running my server locally, and opening the JS file I see nothing compiled, just the standard application.js manifest file : // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib

sass-rails asset pipeline: generating image paths incorrectly; `url(/images/blah.png)` instead of `url(/assets/blah.png)`

折月煮酒 提交于 2020-02-13 04:15:12
问题 In section 2.2.2, "CSS and Sass", I'm told to put image-url('delete.png') in my sass. And so I have. However, it is generating CSS like background-image: url(/images/delete.png) instead of the thing that I'm told everywhere it should be generating, the correct and obvious thing, background-image: url(/assets/delete.png) What. The heck. I have spent literal days trying to figure out where this is coming from. Here's a gist of relevant settings that are resulting in this behavior. Here's a gist

CSS require Syntax

一曲冷凌霜 提交于 2020-02-03 06:29:04
问题 I have required CSS stylesheets many times in many of my RubyOnRails applications, and actually i need a few things demystified. What is the difference between: //=require mystyles and *=require mystyles Both seem to work, so what is the difference? And is this a part of the asset pipeline or a part of SASS or just plain CSS? 回答1: The two examples you gave are exactly the same for stylesheets, however the //= syntax is the only one that works for Javascript. You also need a standard CSS

CSS require Syntax

[亡魂溺海] 提交于 2020-02-03 06:23:26
问题 I have required CSS stylesheets many times in many of my RubyOnRails applications, and actually i need a few things demystified. What is the difference between: //=require mystyles and *=require mystyles Both seem to work, so what is the difference? And is this a part of the asset pipeline or a part of SASS or just plain CSS? 回答1: The two examples you gave are exactly the same for stylesheets, however the //= syntax is the only one that works for Javascript. You also need a standard CSS