asset-pipeline

config.assets.precompile not working

廉价感情. 提交于 2019-12-24 09:57:53
问题 I have a bookmarklet, which needs separate js and css files - i.e. I don't want them compiled as usual into one file. These are the files that I want to separate from the usual js and css files: assets/javascripts/bookmarklet/tagger.js assets/javascripts/bookmarklet/js/bookmarklet.js assets/stylesheets/bookmarklet/bookmarklet-frame.css In application.js and application.css I changed //= require_three . to //= require_directory . And I added: config.assets.precompile += [ 'bookmarklet/js

Can't find CSS after pushing to Heroku

匆匆过客 提交于 2019-12-24 09:25:24
问题 Everything works fine when I run locally, but fails when I push to heroku. I've discovered that I need to modify all of the .css files in app/assets/stylesheets/ to have .css.scss extensions and ensure my Gemfile contains: gem 'sass-rails', '4.0.1' group :production, :staging do gem 'rails_12factor' # for heroku end Within my .css.scss files, I now use image-url() instead of url() to point to the fingerprinted image (fingerprinted and reorganized by heroku and asset compilation business). in

serving large media files from the assets folder in rails

拟墨画扇 提交于 2019-12-24 08:56:54
问题 I want to put some rather large sound files into my assets folder in rails. /app/assets/sounds --- file1.wav ----file2.wav when calling them thru the following URL http://localhost:3000/assets/file1.wav Rails (3.2.x) the file will be "served" (somehow) but I can never play it in the browser. If however I put those files into the public folder they will be served and can be played. I assume this is related to the fact that the public folder isn't touched by rails but is served by rack (afaik).

Heroku Precompiling Assets Failed

喜欢而已 提交于 2019-12-24 07:58:34
问题 My app is suddenly not working after an update. Not sure what's going wrong. Basically, when I push to heroku, I get these errors: Precompiling assets failed, enabling runtime asset compilation Injecting rails31_enable_runtime_asset_compilation And a little higher up: rake aborted! Unexpected token: operator (>) (line: 19073, col: 9, pos: 605247) Error at new JS_Parse_Error (/tmp/execjs20121211-811-1z5vum.js:1720:22) at js_error (/tmp/execjs20121211-811-1z5vum.js:1728:15) at croak (/tmp

Rails: Why doesnt all my scss files get compiled?

南楼画角 提交于 2019-12-24 04:53:12
问题 I am a beginner in rails, and I reckon I haven't got a clear idea on to how the stylesheets should be organised. Currently, I have two files in my assets/stylesheets: application.css home.css When I run rake assets:precompile - I realise that only application.css is compiled into my public/assets folder. What about home.css? More Info I want home.css to load only when the respond is received from my home controller. I have removed *= require_tree . from application.css (since I am guessing

Static url to asset

。_饼干妹妹 提交于 2019-12-24 02:42:09
问题 I have a script my_pub_script.js.coffee written with coffeescript and I want to make it public so anybody can download it on example.com/scripts/my_pub_script.js I can put any files in /public but this is coffee and I had to pass it through asset pipeline to properly compile it to js . But if I compile my script it will have a name with fingerprint suffix like my_pub_script-e55bd5e3eb82fa4e8034af2883dc37e8.js so I don't know the current link to it. Sure I have many other files that I want to

Rails assets aren't compiling after Capistrano deployment

故事扮演 提交于 2019-12-23 22:01:29
问题 I'm deploying my Rails app using Capistrano and it seems that the assets aren't being compiled unless I ssh into the server and run RAILS_ENV=development bundle exec rake assets:precompile manually. I've tried following the instructions on the capistrano/rails github page, but I'm not sure if I've missed something. Running cap production deploy completes successfully. But I don't know how to check whether the assets:precompile task was actually run. Running cap production deploy:assets

Rails 3.1 on Apache, PageSpeed says “Specify Cache Validator” when using Asset Pipeline apache config

别等时光非礼了梦想. 提交于 2019-12-23 18:07:51
问题 I am seeing a conflict between what Rails 3.1 guides suggest, and what Google PageSpeed suggest for managing of cached assets. Rails 3.1 guides for asset pipeline offer a solution Apache server configuration here The salient bit of apache config is: <LocationMatch "^/assets/.*$"> # Some browsers still send conditional-GET requests if there's a # Last-Modified header or an ETag header even if they haven't # reached the expiry date sent in the Expires header. Header unset Last-Modified Header

Why would this JS fire on a form partial rendered on 1 page but not another?

时间秒杀一切 提交于 2019-12-23 16:42:23
问题 I have a posts.js file that looks like this: var ready; ready = function() { var toggleSidebar = $(".togglesidebar"); var primary = $("#primary"); var secondary = $("#secondary"); toggleSidebar.on("click", function(){ if(primary.hasClass("col-sm-9")){ primary.removeClass("col-sm-9"); primary.addClass("col-sm-12"); secondary.css('display', 'none'); } else { primary.removeClass("col-sm-12"); primary.addClass("col-sm-9"); secondary.css('display', 'inline-block'); } }); }; var counter = function

How disable assets compilation on heroku?

妖精的绣舞 提交于 2019-12-23 16:25:47
问题 I'm trying to deploy my rails app to heroku using this turtorial: https://devcenter.heroku.com/articles/getting-started-with-rails4 So, I use rails 4.1.1 and ruby 2.1.1 My Gemfile has gem 'rails_12factor', group: :production inside. My application.rb: require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) module Charticus class Application Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application