How to disable coffeescript on Rails 5

2019-03-12 01:35发布

Recently, I started a new rails 5.1.4 project but I've forgotten add --skip-coffee on rails new.

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

Thanks in advance.

1条回答
姐就是有狂的资本
2楼-- · 2019-03-12 02:31
  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
查看更多
登录 后发表回答