asset-pipeline

Asset fingerprint differs between servers

♀尐吖头ヾ 提交于 2020-01-14 12:37:07
问题 I am deploying my rails 3.2.14 application to 2 different servers with a load balancer in front of them. The assets are currently being precompiled on the server (via capistrano deployment). For some reason the fingerprint on the application.js file is different between the two servers. The source file is identical. IF I remove the //= require_tree . from the application.js then they both magically have the same fingerprint. I've come across a few posts that mention this issue, but never

The asset “application.js” is not present in the asset pipeline

三世轮回 提交于 2020-01-13 11:09:08
问题 I'm new in Ruby and in ROR framework. I try to create web app with JQuery. My steps are: Added gem 'jquery-rails' and executed bundle install command from command line String //= require jquery2 added into application.js file Now I try include file into page. And I added in section string <%= javascript_include_tag "application" %> into application.html.erb file when I try to see page in browser I see error with message: Sprockets::Rails::Helper::AssetNotFound in LandingPage#index The asset

Rails 3.1 asset pipeline doesn't pick up changes to @import'd sheets

旧街凉风 提交于 2020-01-11 16:36:25
问题 I use @import 'd partial sheets to organize my css/sass: /app /assets /stylesheets _constants.sass _layout.sass ... app.css.sass app.css.sass: @import _constants.sass // basic styles @import _layout.sass @import ... app.css.sass has an @import rule for _layout.sass , which allows me to share mixins and variables amongst the raw sass files before they're complied down into app.css The problem is that Rails doesn't recognize changes to the @import 'd partials ( _layout.sass ) and won't

Rails not serving assets in production or staging environments

萝らか妹 提交于 2020-01-11 09:27:11
问题 In the process of debugging this problem, I have tried to run my application in production mode locally and it doesn't serve up any assets. Additionally, I have a staging environment in a Heroku application (separate from my production Heroku application) which is also now displaying the HTML without any assets. To debug, I: Kill the server Clear out tmp/cache/assets Delete public/assets Run rake assets:precompile Start up the server rails s -e production Visit the page and open up web

CSS in Rails Asset Path not processed by ERB in development

╄→尐↘猪︶ㄣ 提交于 2020-01-10 20:06:05
问题 I have a Rails app with the following in /app/assets/stylesheets/styles.css.erb : ... #nestedbg { background-position: left top; background-image: url(<%= asset_path 'siteheader2.png' %>); background-repeat: repeat-x; background-attachment: fixed; } ... When I run rake assets:precompile and then run rails s -e production , everything works as expected. However, when I remove the precompiled assets and run rails s in development, the CSS file comes up as shown above instead of being properly

Rails: Use livereload with Asset Pipeline

别来无恙 提交于 2020-01-09 19:29:42
问题 Quick question for rails pros out there... When working with Rails 3.0.x apps I was a heavy user of Guard and LiveReload. However, it seems that when using the asset pipeline in Rails 3.1 the livereload guard does not know that changes to a Sass file should trigger sending new css to the browser. Is anyone using LiveReload with the Asset Pipeline? If so, how are you making it work? Thanks! 回答1: After following some issue threads on Github I found the following fixed my problem: 1) Make sure

URI mismatch Rails generates MD5 digest in asset URL in production, but controller GET's a non-MD5 URL

蹲街弑〆低调 提交于 2020-01-06 19:37:18
问题 I have a Rails app with a page or two that uses the html5 video tag, and the corresponding Rails video_tag() method to display video on the page. I've added <%= video_tag "car_circle.mp4", width: "640", height: "500", controls: true %> to an html.erb file in views. Rails 3.2 looks for videos in the /public directory, and so I've added my videos to a folder called public/videos . In order to add this folder to the asset pipeline, I added this line to application.rb config.assets.paths << "#

Sprockets generating incorrect logical_path for javascript files

放肆的年华 提交于 2020-01-05 12:16:19
问题 Sprockets seems to make an error in determining the logical_path of my javascript assets (except for application.js). It prepends "../javascripts" to the path and so my references are wrong and the application.js file won't precompile. I'm using Rails Thin server on Windows. Gemfile: source 'http://rubygems.org' gem 'rails', '3.1.3' gem 'eventmachine', '1.0.0.beta.4.1' gem 'thin' gem 'mysql' gem 'win32-open3-19' gem 'paperclip', '2.3.8' gem 'jsmin' gem 'will_paginate' gem 'jquery-rails' #

assets:precompile - permission denied - only on one computer

穿精又带淫゛_ 提交于 2020-01-04 04:43:05
问题 I have a rails app project folder which is on my dropbox folder. I work on 2 computers - home pc and a laptop (both win 7) If I do bundle exec rake assets:precompile on the pc it works fine and I see the line C:/Ruby193/bin/ruby.exe C:/Ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets mkdir -p H:/My Dropbox/project/public/assets cp -r C:/Ruby193/lib/ruby/gems/1.9.1/gems/tinymce-rails-3.5.7.1/vendor/assets/javascripts/tinymce H:/My Dropbox/project/public/assets

Rails ignore ActionView::Template::Error for missing assets

回眸只為那壹抹淺笑 提交于 2020-01-04 04:13:12
问题 ActionView::Template::Error (leagues/lal11.png isn't precompiled): Errors of this sort happen in my app when a new league is added but the corresponding image hasn't been precompiled. I understand why this is happening; the asset manifest is missing the relevant path and so rails can't determine the digest for it. However, killing the whole app because of a simple missing image is stupid. Is there a way to catch this specific exception? 回答1: i could not agree more with you, raising errors for