ruby-on-rails,jquery-file-upload,sprockets,jquery-fileupload-rails
put it outside the assets group and run bundle install. btw jquery-ui-rails does not belong there either...
According to the CSS spec, @import rule must be the first rule in the document (except the @charset rule). And Sass likes to produce valid CSS files, so it pushes all @imports to the top....
javascript,ruby,ruby-on-rails-3,sprockets
Compressing is uglifying. If you don't have that option, then compressing/uglifying doesn't happen. If you want uglifying to happen, enable that option.
ruby-on-rails-3,elastic-beanstalk,sprockets,ruby-2.0,stack-level
I've finally found the reason. That's because of these lines of code which was for supporting Emoji. module ActiveSupport module JSON module Encoding class << self def escape_with_json_gem(string) ::JSON.generate([string])[1..-2] end alias_method_chain :escape, :json_gem end end end end ...
ruby-on-rails,ruby,ruby-on-rails-4,asset-pipeline,sprockets
Sprockets wants to compact everything into a single file and minify it, so typically the pattern is to include all your javascript/stylesheets in the application manifests. There are plenty of good reasons for this pattern. Since it appears you have removed the = require_tree . lines, this is not happening...
javascript,ruby-on-rails,git,asset-pipeline,sprockets
Deleting my local repository / folder and then cloning my remote repository made it work. Probably some caching issue. Might be a better way to get it working though, but I couldn't find any.
ruby-on-rails,heroku,sprockets
As I can see from the source, Sprockets does not have such a hook, but you could use rake task hooks. For example, you would create a rake task that starts all the preprocessors, gulp, etc, so this task could be put before precompilation. # lib/tasks/before_assets_precompile.rake task :before_assets_precompile do #...
ruby-on-rails,ruby-on-rails-4,assets,sprockets
The answer is so mind-numbingly simple I can't believe I didn't think to try it earlier. Carrierwave Example: # It was this before def store_dir "assets/photos#{ '/testing' if Rails.env.test? }" end # Now it's this def store_dir "for/photos#{ '/testing' if Rails.env.test? }" end i.e., folder layout is as such: ..app/...
ruby-on-rails,ruby,sass,gem,sprockets
Okay so here goes: I've found the problem and it was solved by actually supplying a version that works with rails 4.2. The default gem compass-rails installs a version incompatible with sprockets. When I added the specific version as seen here and ran another bundle the versions of most of...
ruby-on-rails,asset-pipeline,sprockets
As I understood, you need always to recompile .erb assets. Here is the solution: Sprockets::Asset.class_eval do alias_method :orig_dependency_fresh?, :dependency_fresh? def dependency_fresh?(environment, dep) if dep.pathname.extname.eql? '.erb' false else orig_dependency_fresh?(environment, dep) end end end ...
I ended up solving this in a slightly different way - using Sass::Rails::ScssTemplate's render method. Basically, I write my altered css string out to a file and pass it into the Sass::Rails::ScssTemplate constructor. I then compile and remove the temp file when it's done. This doesn't feel great, but it's...
ruby-on-rails-3,ruby-on-rails-4,sprockets,tilt
Use bundle show to get the versions of your installed gems. For a particular gem, like tilt, you can use bundle show tilt.
ruby-on-rails,ruby-on-rails-4,coffeescript,asset-pipeline,sprockets
Use redirection like so: def show redirect_to view_context.javascript_path('embed.js.coffee') } end There is a way to render whole js file: def show render text: Rails.application.assets.find_asset('embed.js.coffee').body end ...
jquery,ruby-on-rails,ruby,sprockets
The second line in your application.css file should be: *= require jquery-ui not *= require jquery.ui dash not dot, see here. Same with your application.js file: //= require jquery-ui ...
ruby-on-rails,sass,bundler,bower,sprockets
Go to your rvm gem directory (rvm gemdir) and look for the gem rails-assets pulled (/gems/rails-assets-YOUR_GEM-VERSION). In the app/assets/stylesheets directory find your file. Import/require the file with the path relative to app/assets/stylesheets. The same goes for javascripts (in app/assets/javascripts). This worked for me with rails-assets-bootstrap-sass-official, the file I was...
javascript,ruby-on-rails,sprockets,js-routes,browserify-rails
I’ve spent endless hours on integrating browserify-rails in my project and making JS Routes work within this setup… The solution I came to and described below is the result of me not being able to have Sprockets pre-process my routes file before Browserify would come in. I have spent quite...
i think you need to change your javascript and stylesheet tag like this. it fetches details from application.js and application.css not from default ones <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> ...
ruby-on-rails,assets,sprockets
In production you can only reference (javascript_include_tag, stylesheet_link_tag) assets that have been precompiled. By default this is just application.js and application.css. These top level files (called manifests) contain directives saying what files to include (by default this include app/assets/javascripts/* for example). Anything that is to be referenced directly needs to...
javascript,css,minify,sprockets
I tried it out (example below), and it worked for me. I would suspect that you have an outdated version of Sprockets, since the shorthand minifier notation you want to use was introduced quite recently in version 2.7.0. I would do a gem upgrade and hopefully that fixes it. Example...
ruby-on-rails,github,gem,sprockets
The sprockets-rails includes rails based functionality and rake tasks. In all current versions of Rails (beginning with 3.1), your Sprockets environment is automatically mounted at /assets. Sprockets can be used in conjunction with a Rack app. See: https://github.com/rack/rack for more information regarding Rack apps....
html,css,ruby-on-rails,sprockets
@papirtiger, you were correct. I'm new to this, and just learned how to use version control. Prior to using version control, I made copies of the entire project as I was learning. That's when the additional directory info must have been added. So just simplifying the info to this worked:...
ruby-on-rails,asset-pipeline,sprockets
It turns out that mixing engine and application layouts is fairly tricky so I took a different approach. One that also gems like devise seem to use: I wrote generators in my gem that copy the views to the app and others that create decorators for controllers in which one...
ruby-on-rails,ruby-on-rails-4,sprockets
I found a way to rig this up to work, but I feel it is not the best solution: = javascript_include_tag "application", :async => Rails.env == "production" ...
ruby-on-rails,asset-pipeline,sprockets
I appreciate that Rails 3.2 is a little past its sell-by-date, what with Rails 5 having been announced and all, but until someone donates a month's worth of spare time (contact me for details) I'll have to keep this thing running. Luckily, once my cold had cleared, it wasn't too...
javascript,ruby-on-rails-4,datepicker,sprockets,turbolinks
It looks like turbolinks problem which are added to rails 4 by default. In turbolinks $(document).ready is not always firing. You can see more information about turbolinks and some suggestions how to use them here railscast or you can add to some links data: { no_turbolink: true } You can...
ruby-on-rails,capistrano,asset-pipeline,sprockets
I've solved the problem by moving my angular_js gem out of the assets group and into the all group in my bundler. I also did an apache restart from within the server instead of rebooting from the hosting website. Thanks for all the help though!