asset-pipeline

Something's wrong with assets - each page in local takes over 1.5 mins to load

天涯浪子 提交于 2019-12-08 03:59:28
问题 Since I moved to active_admin my local server takes over 1.5 minutes to load each and every page. I'm surely doing something wrong. Development.rb config.assets.compress = true; config.assets.debug = true; config.assets.compile = false; config.assets.digest = false Production.rb config.assets.compress = true; config.assets.compile = true; config.assets.digest = true; config.assets.precompile += ['active_admin.js', 'active_admin.css'] Note the compile is true in production because active admin

how to use tinymce content.css in rails

社会主义新天地 提交于 2019-12-08 02:20:20
I need to provide tinymce a css file to take the styles from, but if I set in any file something like body{ font-size: 14px; } it will set the webapp's body to that style and not only tinymce's input box. How do I give tinymce a content.css file with the asset pipeline involved? Nick Ginanto the proper format for this is to write body.mceContentBody { font-size: 14px; } or in TinyMCE 4.x (class name changed) body.mce-content-body { font-size: 14px; } and the tinymce (if using the gem) should be <%= tinymce :content_css => asset_path('application.css')%> 来源: https://stackoverflow.com/questions

Rails 3.1 assets:precompile Connecting to Database

此生再无相见时 提交于 2019-12-08 00:15:03
问题 I'm trying to deploy an application to Heroku after upgrading to Rails 3.1 with the asset pipeline. I ran into the common issue mentioned on Heroku's troubleshooting page when receiving the error: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port xxxx? I took the suggestions on the page and added the following to my config/application.rb file (after also trying to add it to the individual [environment].rb files

Rails 4 Asset Pipeline: Compile both with and without fingerprint

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 18:51:32
问题 Rails 4 has changed the way assets are fingerprinted (for browser cache busting): Old Strategy: application.css?12345 Rails 3.2: application-12345.css and application.css Rails 4.0: application-12345.css While this makes perfect sense, it's a problem if the stylesheets are used by another service (in our case Zendesk). This external site needs the CSS from the Rails app, but it doesn't know the fingerprint (aka: digest). Is there a way to compile all assets both with and without fingerprint?

rake assets:precompile is slooooow. Any way to speed it up?

随声附和 提交于 2019-12-07 15:30:54
问题 I have a Rails 3.2 app running on Heroku, and it uses CKEditor. Now, CKEditor is a pretty large collection of files and folders, and is probably the biggest contributor to the time it takes to precompile assets. A regular push to Heroku takes well over a minute on the assets:precompile step. So I now precompile locally, and only when I've made edits, before I push to Heroku, to shorten deploy times. However, my poor old Windows laptop easily breaks 15 minutes for rake assets:precompile. This

Assets path issue with S3

試著忘記壹切 提交于 2019-12-07 15:18:35
问题 In production, I use Heroku and dynamic assets on S3. It works fine. Now I try to send my statics assets to S3. I followed this tutorial https://devcenter.heroku.com/articles/cdn-asset-host-rails31 I added asset_sync gem, I configured my heroku ENVs, my config/production.rb and I run heroku run rake assets:precompile It seems to work fine : Using: Directory Search of /app/public/assets Uploading: assets/application.js.gz Uploading: assets/application.css Uploading: assets/application

Why won't my css changes show without me restarting WEBrick?

空扰寡人 提交于 2019-12-07 13:00:55
问题 I am doing some simple css edits on a rails 3.2 project and my changes will not show up unless I restart webrick. I came across something saying that it may be using the public/assets directory, but I don't think this is the case because my changes show when the server is restarted. Not sure why this is happening. Does anyone know if there is some sort of configuration that I need to fix to solve this problem? 回答1: bundle exec rake assets:clean run this command 回答2: I added this to my

Determining which assets are not being used in Rails?

白昼怎懂夜的黑 提交于 2019-12-07 11:56:55
问题 I'm using the asset pipeline in Rails and we have many haml partials that some are probably not used, along with unused images. How do you work out if an asset is not being used, e.g. images, haml, etc.? Is there an automated way to find out? 回答1: I found some links but haven't tried them yet. I will report back when I get a chance to try them out: discover-unused-partials A script to help you finding out unused partials. Good for big projects or projects under heavy refactoring. Covers Haml

ExecJS::RuntimeError: SyntaxError: Unexpected token operator

*爱你&永不变心* 提交于 2019-12-07 11:10:24
问题 RAILS_ENV=production rake assets:precompile --trace Digest::Digest is deprecated; use Digest Digest::Digest is deprecated; use Digest ** Invoke assets:precompile (first_time) ** Invoke assets:environment (first_time) ** Execute assets:environment ** Invoke environment (first_time) ** Execute environment ** Execute assets:precompile rake aborted! ExecJS::RuntimeError: SyntaxError: Unexpected token operator «=», expected punc «,» (line: 159, col: 25, pos: 5132) Error at new JS_Parse_Error (/tmp

javascript functions available via javascript_include_tag but not asset pipeline and application.js

让人想犯罪 __ 提交于 2019-12-07 09:04:05
问题 My apologies if this has been posted somewhere else, but I'm not exactly sure how to even phrase a search for this problem. Basically, I've got fullcalendar.js sitting in app/assets/javascripts/ . Within my application.js file (in the same folder of course) I've got the following... //= require jquery //= require jquery_ujs //= require foundation //= require_tree . So, as expected the fullcalender.js gets swept up in the asset compiling process and ends up in the application.js that is then