禁用资产管道/链轮导轨 4.1 [英] Disable Asset Pipeline/Sprockets Rails 4.1

查看:29
本文介绍了禁用资产管道/链轮导轨 4.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到在 Rails 4.1 中禁用资产管道的方法.我看到很多关于 Rails 3.2 的信息.

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.

我想使用 Grunt/GulpJs 和 bower 来处理我的所有资产,但我似乎无法为此找到一些东西.相反,我找到了一个不错的数量,但其中大部分不适用于我或已损坏.

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.

half-pipe gem.然而,半管道依赖于 Rails 4.0,而我使用的是 Rails 4.1,如果可能的话,我找不到在哪里强制 Gem 安装在不同版本的 Rails 中.

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.

这个问题扩展成比我预期的更多的问题.基本上我只需要知道如何禁用 Asset Pipeline,除了如何集成 GruntJS.

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.

推荐答案

您可以在 config/application.rb 中通过添加以下行来禁用资产管道:

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

config.assets.enabled = false

您还可以在创建新的 rails 应用程序时通过将 --skip-sprockets 选项传递给它来关闭资产管道:

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

这篇关于禁用资产管道/链轮导轨 4.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆