Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Asset Pipeline/Sprockets Rails 4.1

I cannot seem to find a way to disable the Asset Pipeline in Rails 4.1. I see a lot of information for Rails 3.2.

I want to use Grunt/GulpJs and bower to handle all of my assets and I cannot seem to find something for this. Rather I find a decent amount but most of it doesn't apply to me or is broken.

There is the half-pipe gem. However half-pipe relies on Rails 4.0 and I'm on Rails 4.1 and I can't find where to force a Gem to install in different version of Rails, if that's even possible.

This question expanded into a few more questions than I intended. Basically I just need to know how to disable the Asset Pipeline, barring that how to integrate GruntJS.

like image 856
Patrick Cauley Avatar asked Mar 22 '14 01:03

Patrick Cauley


People also ask

How do you Precompile an asset?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.

What are sprockets Rails?

Sprockets is a Ruby library for compiling and serving web assets. Sprockets allows to organize an application's JavaScript files into smaller more manageable chunks that can be distributed over a number of directories and files.

What is Require_tree?

The require_tree directive tells Sprockets to recursively include all JavaScript files in the specified directory into the output. These paths must be specified relative to the manifest file.


1 Answers

You can disable the asset pipeline in config/application.rb by adding the following line to it :

config.assets.enabled = false 

You could also turn off asset pipeline while creating a new rails application by passing the --skip-sprockets option to it:

rails new myappname --skip-sprockets 
like image 194
Kirti Thorat Avatar answered Oct 08 '22 01:10

Kirti Thorat