JuanCrg90
JuanCrg90

Reputation: 1016

How to disable coffeescript on Rails 5

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

Upvotes: 37

Views: 6593

Answers (1)

ogirginc
ogirginc

Reputation: 5270

  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

Upvotes: 81

Related Questions