asset-pipeline

How to use sass-rails helpers in Ruby?

时光毁灭记忆、已成空白 提交于 2019-12-12 01:49:32
问题 From the Github page it would seem that one can use the Sass helpers ( asset_path , asset_url , image_path etc.) in Ruby but I can't figure out how. I need to set the default_url for a Paperclip attachment and want to use one of my assets from the asset pipeline for that. 回答1: You can use the sass helpers in SCSS files, but you cannot use them elsewhere. In those cases you need to use the regular asset_path and image_tag helpers. 来源: https://stackoverflow.com/questions/7636204/how-to-use-sass

application.js isn't precompiled

≡放荡痞女 提交于 2019-12-12 01:03:49
问题 I'm not sure why, but whenever I run rake assets:precompile , application.js doesn't get compiled. I get a "application.js isn't precompiled" error in production mode. Here is my Gemfile if it means anything: source 'http://rubygems.org' gem 'rails', '3.1.1' gem 'eventmachine', '1.0.0.beta.4.1' gem 'thin' gem 'mysql' gem 'win32-open3-19' gem 'paperclip', '2.3.8' #gem 'jammit' gem 'jsmin' gem 'will_paginate' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git'

Rails 3.1.3 unable to access the file inside assets/javascripts folder

好久不见. 提交于 2019-12-12 01:03:43
问题 I have put fancybox (jquery plugin ) inside the assets/javascripts/includes/jquery.fancybox-1.3.4 Before this location i also tried to put it under /vendor/assets/stylesheets/jquery directory. I am getting this weird error & why isn't rails able to get the particular file when its right there. ------------- Development Log ---------------- Started GET "/vendor/assets/stylesheets/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js" for 127.0.0.1 at 2011-11-25 13:30:42 -0800

JavaScript not working in Rails app in production

蹲街弑〆低调 提交于 2019-12-12 01:00:53
问题 I just moved my Rails app to a production server through git and none of my JavaScript is working. I ran rake assets:precompile and nothing. My Rails production log and my nginx log show no errors. Inside public/assets I see application-###.js . Does anyone have any ideas or where else I can look? My production.rb log looks like so: Connecting to database specified by database.yml Started GET "/" for 99.179.144.13 at 2013-04-03 04:13:42 +0000 Processing by StaticPagesController#index as HTML

Rails Asset Pipeline - wrong fingerprint

混江龙づ霸主 提交于 2019-12-11 23:58:17
问题 My Rails 4 application has new.html.erb which has a reference to form.html.erb : # app/assets/templates/jobs/new.html.erb ... <ng-include src="'<%= asset_path("jobs/form.html") %>'"></ng-include> ... # app/assets/templates/jobs/form.html.erb my form is here (ng-include is AngularJS directive) The problem is, that when form.html.erb changes, the production environment still loads the old form.html.erb . This is happening probably because new.html.erb hasn't been changed, and therefore has the

Javascripts not precompiled?

元气小坏坏 提交于 2019-12-11 19:33:34
问题 in my app/assets/javascripts/specific.js I have //= require_tree ./specific in app/assets/javascripts/specific/chat I have pusher.js Also, in config/environments/production I have config.assets.precompile += %w( specific.js some_other_manifest.js ) However, when I go into production (on heroku) it still complains pusher.js is not precompiled. What am I doing wrong here? While the application is deployed, the javascript files seem to be compiled. from Heroku logs: Compiled specific/chat/pusher

Rails Assets custom manifests are not precompiling

被刻印的时光 ゝ 提交于 2019-12-11 14:07:27
问题 I have a scenario as follows. I've built a "themed" site using the asset pipeline. There are a variety of manifests: application.scss application_light.scss application_dark.scss When I run rake assets:precompile , only application.scss gets compiled and created as application.css. I have no trouble with these assets in development, it is only in production pre-compilation that they fail. I have tried: config.assets.precompile += %w( application_light.scss ) This also does not work, it simply

Why does Heroku re-compile my assets after the application has been idle for a while?

自闭症网瘾萝莉.ら 提交于 2019-12-11 13:46:53
问题 In production (on Heroku), shouldn't the assets be compiled on bootup one time, and then never compiled again? /production.rb config.serve_static_assets = false config.assets.compress = true config.assets.compile = false config.assets.digest = true When someone doesnt hit my application for a while things go idle, and it seems that the assets are re-compiled when that new, fresh request comes in??? Any idea what im doing wrong? 回答1: On Heroku, if your application is idle for an hour, the

assets:precompile connects to DB when initialize_on_precompile is false

橙三吉。 提交于 2019-12-11 12:52:21
问题 I have config.assets.initialize_on_precompile = false in my config/application.rb and bundle exec rake assets:precompile still attempts to connect to my DB. I changed my db name in database.yml to a non-existent database so I can tell when it's trying to connect. $ be rake assets:precompile rake aborted! FATAL: database "aaa" does not exist 回答1: According to Heroku, this config is only available in Rails 3.x. You can also see here in rails/rails repo on Rails 4 that the config for assets isn

Grails asset pipeline exclude not working

岁酱吖の 提交于 2019-12-11 12:31:10
问题 I have a project on Grails and angular.js. Also I have tests which runs on karma+jasmin. My directory structure is: grails-app assets images javascripts locales stylesheets test On production all my assets are building on bamboo. The problem is that I want to exclude from compiling test folder with all that inside of it and can't do that. In my Config.groovy I've added grails.assets.excludes = ["test/**/(*.js|*.json)"] Also I've tried different patterns for exclude and they all not working.