Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails won't load asset pipeline

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

like image 719
fabricioflores Avatar asked Apr 15 '13 17:04

fabricioflores


People also ask

How to enable asset pipeline in Rails?

The asset pipeline is implemented by the sprockets-rails gem, and is enabled by default. You can disable it while creating a new application by passing the --skip-asset-pipeline option. The sassc-rails gem is automatically used for CSS compression if included in the Gemfile and no config. assets.

What is Rails assets precompile?

The Rails asset pipeline provides an assets:precompile rake task to allow assets to be compiled and cached up front rather than compiled every time the app boots. There are two ways you can use the asset pipeline on Heroku. Compiling assets locally. Compiling assets during slug compilation.

What is asset_ path?

asset_path(source, options = {}) public. This is the entry point for all assets. When using the asset pipeline (i.e. sprockets and sprockets-rails), the behavior is “enhanced”. You can bypass the asset pipeline by passing in skip_pipeline: true to the options. All other asset *_path helpers delegate through this method ...


1 Answers

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.debug = true in your development.rb.

like image 62
Kevin Sylvestre Avatar answered Nov 10 '22 14:11

Kevin Sylvestre