如何在Rails 5上禁用coffeescript [英] How to disable coffeescript on Rails 5

查看:72
本文介绍了如何在Rails 5上禁用coffeescript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始了一个新的 rails 5.1.4 项目,但是我忘了添加-skip-coffee 引入了新的

I started a new rails 5.1.4 project but I have forgotten to add --skip-coffee on rails new.

是否可以删除咖啡脚本依赖项而无需正在创建新项目?。

Is there a way to remove the coffeescript dependency without creating a new project?.

推荐答案


  1. 删除或注释掉 gem' Gemfile 中的coffee-rails'

  2. 更改以结尾的Javascript文件.js.coffee .js

  3. 添加 config.generators。 javascript_engine =:js 到您的 application.rb

  4. 确保使用 rake tmp:cache:clear tmp 缓存>

  1. Remove or comment out gem 'coffee-rails' from Gemfile.
  2. Change Javascript files that ends with .js.coffee to .js.
  3. Add config.generators.javascript_engine = :js to your application.rb.
  4. Make sure your tmp cache is cleared with rake tmp:cache:clear

这篇关于如何在Rails 5上禁用coffeescript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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