How to disable coffeescript on Rails 5
Asked Answered
S

1

36

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?.

Seurat answered 13/12, 2017 at 2:34 Comment(0)
M
80
  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
Menado answered 19/2, 2018 at 17:33 Comment(4)
Worked in Rails 5.2.1 (I forgot to add the switch when I created the project too - duh!)Incrassate
Would have never thought of clearing cache. And that did it. Thanks.Unknowing
No need to change the javascript_engine generator with Rails 5.2.4.4 (I still had to clear the cache)Bread
Just a thought - Don't you have to do a 'bundle' if you change Gemfile?Thickskinned

© 2022 - 2024 — McMap. All rights reserved.