asset-pipeline

Javascript is cached in development mode with asset pipeline

梦想的初衷 提交于 2020-01-01 01:48:09
问题 I recently upgraded my application to rails 3.1 and generally everything seems to be working but one thing is driving me insane. I have 2 main js files, we'll call them, application.js and main.js. application.js has my manifest stuff in it and is loading in main.js. That's working fine. My problem is when i'm in development mode and i make a change to main.js, then refresh the page the site doesn't pick up the change. In order to pull in the change I have restart the rails server. I have

How to use Less in a rails 3.1 application?

我的梦境 提交于 2019-12-31 22:27:21
问题 What is the easiest (is there an easy way?) to use Less (in combination with Sass/Scss) in the rails 3.1 assets pipeline? I want to load a file like foo.css.less like i would do for bar.css.scss I found some wonky solution that does not work for me (haven't tried a lot) : https://github.com/thisduck/ruby-less-js/issues/2 The idea would be to use Twitter Bootstrap in a clean way. Thanks in advance 回答1: If you only want to use bootstrap, you can do it by including the 'less-rails' and 'less

Add a JavaScript display to the Home page to count down from 140 characters. (Rails Tutorial, 2nd Ed, Chapter 10, Exercise 7)

[亡魂溺海] 提交于 2019-12-31 13:13:34
问题 This exercise was a bit tricky. Figured I'd post my solution to see if anyone did it differently or if there's anyone who knows a better way. I'm not sure on best practices for using the Asset Pipline .. for example, the correct order to put things in the application.js manifest file, or when to put things in lib versus app. I just put the following in lib to try getting it to work. From Michael Hartl's Rails Tutorial 2nd ed Chapter 10, Exercise 7: (challenging) Add a JavaScript display to

rails - application.css asset not found in production mode

柔情痞子 提交于 2019-12-31 08:45:48
问题 I'm upgrading an application to use the asset pipeline. I've got the css assets compiling into an application css file but they not being found when I run the application in production mode with RAILS_ENV=production bundle exec rails s and I visit any page I get the correct output from the database but no styling and the log shows: ActionController::RoutingError (No route matches [GET] "/assets/default.scss-1a27c...f07c.css"): Even though that file exists in public/assets $ ls public/assets

rails - application.css asset not found in production mode

萝らか妹 提交于 2019-12-31 08:45:12
问题 I'm upgrading an application to use the asset pipeline. I've got the css assets compiling into an application css file but they not being found when I run the application in production mode with RAILS_ENV=production bundle exec rails s and I visit any page I get the correct output from the database but no styling and the log shows: ActionController::RoutingError (No route matches [GET] "/assets/default.scss-1a27c...f07c.css"): Even though that file exists in public/assets $ ls public/assets

Rails won't precompile .js.erb

谁说我不能喝 提交于 2019-12-31 06:12:45
问题 Why Rails won't precompile a .js.erb asset? My config/application.rb : require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(:default, Rails.env) module Sflitmap class Application < Rails::Application # these precompile OK config.assets.precompile += ['edge/edge.1.5.0.min.js', 'edge/ink-falling_edgeActions.js', 'edge/inkAnimationTrigger.js'] # this will not precompile config.assets.precompile += ['edge/ink-falling_edge.js.erb'] end end My config/environments

Rails 5.1.2 bootstrap icons not being served in production

℡╲_俬逩灬. 提交于 2019-12-31 05:35:28
问题 This is an Awesome place. I hope to be competent enough soon to contribute solutions. Please, somebody help!!?! I have watched hours of youtube and read every post about asset pipeline pre-compilation on the web. For whatever reason I decided to use Rails 5.1.2 and I don't know if that is the problem. glyphicons don't render on Heroku or using rails s -e production on my local ubuntu. I type rake assets:precompile RAILS_ENV=production and get I, [2018-01-01T16:05:07.261287 #4745] INFO -- :

Asset pipeline DEPRECATION WARNING tsort.rb:226

一世执手 提交于 2019-12-31 03:00:08
问题 I have rails 4.2 working fine on development but in production env I have the following warning: DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in tsort_each at

How to get ckeditor resources to compile and load in Rails 3.1 asset pipeline

孤街浪徒 提交于 2019-12-30 21:27:00
问题 I'm trying to use CKEditor in a Rails 3.1 app. I have the ckeditor directory in app/assets/javascripts/ckeditor/, with extraneous stuff like the uncompressed and modularized source removed. It works fine in development. In production or staging environments, ckeditor can't find it's own files: config.js, lang/en.js skins/kama/editor.css. I can see that these files are not being precompiled, which makes sense since the asset pipeline by default won't include or precompile anything that matches

Rails won't load asset pipeline

倾然丶 夕夏残阳落幕 提交于 2019-12-30 18:26:23
问题 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