Questions tagged [sprockets]

Sprockets is a Ruby library that preprocesses and concatenates JavaScript and CSS source files.

Sprockets takes any number of source files and preprocesses them line-by-line in order to build a single concatenation.

Specially formatted lines act as directives to the Sprockets preprocessor, telling it to require the contents of another file or library first or to provide a set of asset files (such as images or stylesheets) to the document root.

Sprockets attempts to fulfill required dependencies by searching a set of directories called the load path.

807 questions
0
votes
1 answer

Precompiling assets that are created by model

I have a question relating to how precompiled assets are utilized in a production environment. What about general file attachments as a part of the model? For example, I have the model "Event". You can have n attachments to the model, and they can…
0
votes
1 answer

Stylesheets in Rails App are incorrectly scoped

I have my main application css and I want to exclude my backend stylesheets since the styles all bleed over when application.css executed *=require_tree . I currently have my folders setup like so: assets/ stylesheets/ main/…
Davey
  • 1,093
  • 1
  • 13
  • 25
0
votes
1 answer

NameError (uninitialized constant Sprockets::Secretary): in TeamBox (crewmate)

I am trying to run the TeamBox fork crewmate on branch master, which uses Rails 3.0.20. Running in Development on my machine, when I open any page in the browser, the log shows the following entries: NameError (uninitialized constant…
maggix
  • 3,268
  • 1
  • 22
  • 36
0
votes
1 answer

rake assets:precompile not working always showing : read': No such file or directory - assets:precompile:all

I am using ubuntu 64-bit machine using, rvm, ruby 1.9.3-p448 , rails 3.2.13 And am not able to precompile assets. I used following commands but got same error always :- rake assets:precompile RAILS_ENV=production rake assets:precompile bundle exec…
Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39
0
votes
2 answers

zurb-foundation gem not added to asset path in existing Rails 3.2 application

I have an existing Rails 3.2.14 application that I am trying to add zurb-foundation to. I have added the zurb-foundation gem and run the installation generator. My problem is that, whenever I try to load a page, I get this error: couldn't find file…
nachbar
  • 2,643
  • 1
  • 24
  • 34
0
votes
1 answer

Errno::EACCEs...something to do with 'Sprockets'

Can anyone tell me how I can resolve this error that has started appearing in my app? Thanks for any help. Soemthing to do with...Sprockets? My app was working fine until recently. With regards 'line 9', application.js is in the admin folder, in…
CHarris
  • 2,693
  • 8
  • 45
  • 71
0
votes
1 answer

Rake assets:precompile fails with: couldn't find file 'handlebars'

Running the command during a capistrano deploy: bundle exec rake RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile returns rake aborted! couldn't find file 'handlebars' (in…
Luke Plewa
  • 31
  • 5
0
votes
1 answer

Rails 4 : undefined local variable or method 'asset_paths' inside OldImagePath module

I migrated my Rails 3.2.13 application to Rails 4.0, by creating a fresh new Rails 4 application and migrating the app/config/lib/db/routes/Gemfile/public into it. Everything seems to be working ok except for the following error: Whenever I call…
wael34218
  • 4,860
  • 8
  • 44
  • 62
0
votes
0 answers

Packing together javascript files a .NET Web Application

I am writing a simple web app using NancyFX and the Razor view engine. I have little components in my web app that are having css, html and JavaScript. Each small component has its own folder in my Visual Studio solution. When compiling I would…
gyurisc
  • 11,234
  • 16
  • 68
  • 102
0
votes
1 answer

instance variable not passed to assets js file in Rails 4 rc1

Hi I am using Rails 4rc1. Really cant figure it out, why @feed.id isnt recognized in my feeds.js file. Thx for help. NoMethodError in Feeds#index Showing myapp/app/views/layouts/application.haml where line #6 raised: undefined method `id' for…
daniel
  • 3,105
  • 4
  • 39
  • 48
0
votes
0 answers

Requiring sprockets and rack

I am writing a web application that loads starts Websocket right after the initial page load. It uses the gems sprockets, rack, thin and em-websocket. When I require the files in this order: require "sprockets" require "rack" require "thin" require…
sawa
  • 165,429
  • 45
  • 277
  • 381
0
votes
2 answers

asset_path returns wrong path for folder

I have .swf files under vendor/assets/images/swf/. I need the asset path of that folder. But this (.js.coffee.erb) #= soundmanager2 $ -> soundManager.setup url: '<%= asset_path "swf/" %>' is rendering this (.js): (function() { var $ =…
michelpm
  • 1,795
  • 2
  • 18
  • 31
0
votes
0 answers

Rails assets still being served in single file in development

In my development.rb I have config.assets.debug = true config.assets.compress = false However my assets are being served in single files" images/application.js javascripts/application.css I have deleted the cache files from tmp/cache & restarted…
Sean
  • 2,018
  • 4
  • 25
  • 32
0
votes
1 answer

Rails assets precompilation removes functions from global scope (TypeError: object is not a function). How to get them back?

I have such a js code: function Global(params) { ... } var g = { onDocLoad: function() { // on DOM load I instantiate the Global function-constructor // which is above this line, so it is already in scope var global = new…
Green
  • 28,742
  • 61
  • 158
  • 247
0
votes
1 answer

Sprockets - Add Id Attributes to Javascript Files

I am using Rails 3.2.13 with the asset pipeline. In development mode, my JavaScript files output is like the following below when using the manifest file: