FAQ Database Discussion Community


Sprockets::FileNotFound…could not find css file

html,css,ruby-on-rails,sprockets
I have code that has worked for a similar iteration of this site previously, but am now running up against this error... Sprockets::FileNotFound in Quarterback#index with the detail of... couldn't find file '../../../../xoi_f/app/assets/stylesheets/public.css' under '/Users/Charlie/Sites/xoi_g/app/assets/stylesheets' with type 'text/css' The file public.css does in fact exist, and in the application.css file,...

Prevent Rails 4 Sprocket Asset Pipeline from caching a specific file

ruby-on-rails,asset-pipeline,sprockets
I have a file globals.css.scss.erb which only contains: <%= Styles.output %> Styles is a custom module to output formatted SCSS/SASS global variables based on a YAML file. My issue is that when I change the YAML file, globals.css does not get updated (i.e., it's cached by Sprockets). I want to...

Rails - How to find tilt version?

ruby-on-rails-3,ruby-on-rails-4,sprockets,tilt
Gem tilt is used with sprockets for Rails assets precompile. We are having hard time to find the version running on our Rails 4 app as tilt --version returns version unknown: $ tilt --version tilt: version unknown tilt --help give no info about how to find version. Is there way...

Rails - How to pass Sprockets::Context in manual sass compiling

ruby-on-rails,sass,sprockets
I'm using the following code snippet to manually compile a sass manifest with some variable overrides appended. template = File.read("#{Rails.root}/app/assets/schemes/#{scheme}/css/styles.css.scss") scheme_variables.each do |key, value| template << "$#{key}:#{value};\n" end engine = Sass::Engine.new(template, { :syntax => :scss, :cache => false, :read_cache => false, :style => :compressed, :filesystem_importer => Sass::Rails::SassImporter, :load_paths => MyApp::Application.assets.paths,...

Requiring javascript from files overriding assets of a rails engine

ruby-on-rails,asset-pipeline,sprockets
I wrote a rails engine and want to be able to customize it in any application mounting it. [ENGINE/]app/assets/my_engine/application.js: //= require jquery //= require ./engine_specific //= require ./engine_customization [APP/]app/assets/my_engine/engine_customization.js: //= require selectize $(document).ready(function () { $('select').selectize(); }); This causes a js error (selectize is not a function) I tried requiring...

How to Use Sprockets Gem Properly with Rails 4

ruby-on-rails,ruby,ruby-on-rails-4,asset-pipeline,sprockets
As a bit of pre-text, I am used to Rails 2 but started building a sample app to get used to Rails 4 and I am having a nightmare with Sprockets and the asset pipeline even after reading the official guide and every question I can find on SO. My...

rails uninitialized constant Sprockets::SassCacheStore

ruby-on-rails,ruby,sass,gem,sprockets
I'm new to rails and trying to do some playing around with gems and such. My case here is that I have this navigation menu on my website and I needed to get the current_page link selected.. rather than building a helper I wanted to install a gem so I...

Precompiling assets for a multi-homed Rails application

ruby-on-rails,asset-pipeline,sprockets
I have a multi-homed Rails 3.2 application where each "home" has its own skin. The assets for these are precompiled using a custom Rake task: require "fileutils" namespace :assets do namespace :precompile do task :homes, [:short_name] => ["assets:environment"] do |t, args| include Sprockets::Helpers::RailsHelper homes = args.short_name ? home.where(:short_name => args.short_name)...