asset-pipeline

Rails won't load asset pipeline

馋奶兔 提交于 2019-12-30 18:26:06
问题 I ran rake assets:precompile by mistake on development, and Rails stopped loading the assets on development. I only get application.js and application.css loaded. application.js: //= require jquery //= require jquery_ujs //= require_tree . application.css: *= require_self *= require_tree . Using Rails 3.2.2 回答1: Try deleting the compiled assets from your local development environment: rm -rf public/assets Edit: In addition, make sure to set config.assets.compress = false and config.assets

Rails 3.1 Asset Pipeline - Why should I use the Asset Helpers in a SCSS file?

为君一笑 提交于 2019-12-30 11:38:31
问题 I'm just getting into the Asset Pipeline; I'm using SASS/SCSS, but I'm not understanding why I should be using the Asset Helpers. For example, if I have some CSS/SCSS without using an Asset Helper: background-image: url('rails.png'); This will work fine because both my .SCSS file and image are in and accessible through the assets directory. What's the point of doing this?: background-image: asset-url("rails.png", image); I understand it will add "/assets/" to the url, but why should I be

Adding custom folder to asset pipeline in Grails

纵然是瞬间 提交于 2019-12-30 10:22:49
问题 I have a Grails application. I have the js, css and image folder in the web-app and in the same folder I have a themes folder. I am planning to use the asset pipeline plugin. How should I use my themes folder? I have files with the same names in the core folders and the themes folder. Any help on this? 回答1: Custom folders are supported in the asset pipeline. I will show you an example using Bootstrap. We create a root level directory in the assets folder called themes, this is where we will

Adding custom folder to asset pipeline in Grails

帅比萌擦擦* 提交于 2019-12-30 10:21:27
问题 I have a Grails application. I have the js, css and image folder in the web-app and in the same folder I have a themes folder. I am planning to use the asset pipeline plugin. How should I use my themes folder? I have files with the same names in the core folders and the themes folder. Any help on this? 回答1: Custom folders are supported in the asset pipeline. I will show you an example using Bootstrap. We create a root level directory in the assets folder called themes, this is where we will

Rails 4.0.3 generating incorrect asset paths with asset_sync

爷,独闯天下 提交于 2019-12-30 06:28:05
问题 I have used the asset_sync gem many times before with great success, but using it in a Rails 4.0.3 project seems to have caused a problem. The assets are uploaded, hashed and gzipped to the target directory (I just went with the default 'assets'), but when running the application in staging/production environment the paths are incorrect. They take on the form: S3_DOMAIN.com/stylesheets/application.css Instead of: S3_DOMAIN.com/assets/application-HASH.css Has anyone else experienced this

Ruby on Rails: heroku run rake assets:precompile

房东的猫 提交于 2019-12-30 01:08:08
问题 Please help me understand what heroku run rake assets:precompile exactly does. Ever since I began working on ruby on rails, I would always run these three commands before I push to github and heroku: bundle exec rake assets:precompile RAILS_ENV=production bundle exec rake assets:precompile After I push to heroku, I would run: heroku run rake assets:precompile However, when I tried to run it after my last push to heroku, I got a bunch of the same errors on different files. For example: Warning

Ruby On Rails 3.1 - assets pipeline - assets rendered twice

痞子三分冷 提交于 2019-12-29 18:23:11
问题 Big Update : As I finally found the real solution, I also discovered the real problem. As I wrote down here a lot of useless information, considering the real problem, I'm making a huge update of the question so that other people can find easily what's going on and can see the solution. The Problem : It's because of the assets pipeline of Rails 3.1 Actually... It's an easy one: the assets were rendered twice in development-environment. Doing lot of investigations shew me that my Rails 3.1

Engine's assets with Rails 3.1

自作多情 提交于 2019-12-29 11:47:23
问题 How should one provide assets in an engine in Rails 3.1? Where should they be located and can they be included automatically? (originally asked by Tomas Celizna) 回答1: The paths to the all the engines' assets folders are automatically loaded. The assets themselves are not loaded by default. This is understandable as the loading is done with require_tree . , which loads all css/js from the current folder (i.e. the main application assets' folder) but doesn't say anything about the engines

Updated CSS Stylesheet not loaded following deployment to Heroku?

偶尔善良 提交于 2019-12-29 07:16:10
问题 This has been a problem for me for a while now, but I still can't figure out how the asset pipeline works in Rails 4. I finally learned how to pre-compile assets, but once again after deployment, my CSS Stylesheet isn't getting updated. I confirmed this by going to Developer Tools and viewing the source. It looks different from my CSS files. My guess is the problem lies in my production.rb file. Production.rb Games::Application.configure do config.cache_classes = true config.eager_load = true

Assets not being run though the .erb preprocessor

醉酒当歌 提交于 2019-12-29 07:11:28
问题 I am having trouble trying to rake assets:precompile in my rails 3.1 app. I keep getting the following error: rake aborted! Invalid CSS after "...und-image: url(": expected ")", was "<%= asset_path(..." It seems that the erb preprocessor is not being invokeb but my file is called style.css.scss.erb . Any suggestions? 回答1: Ruby documentation seems a bit unclear on a few things such as the usage of the asset_path and other such helper in stylesheets. Anyways this is what I did to get around the