javascript_include_tag throws unsupported method

China☆狼群 提交于 2019-11-28 12:33:57

I recently found another solution for this problem. gem 'coffee-script-source' in 1.9.0 has some issues with Rails on Windows. I reverted to the previous version using gem 'coffee-script-source', '1.8.0' in the Gemfile, this will resolve your problem.

Another way of solving this exception is installing Node.js onto your machine and the error should go away after installing & restarting rails server. Make sure that you add Node.js into your PATH before restarting the terminal(s) and rerun the server.

Ahh, it seems that you are missing

//= require turbolinks

in your application.js

See this on removing turbolinks (and obviously make sure it's all in place if you want it running).

John Thompson

I am running Windows 10, Ruby 2.1.7p400 and Rails 4.2.4. I could not get gem coffee-script-source '1.8.0' to install as gem insisted on version 1.9.1.1. I tried changing ExecJS to use UTF-8 encoding and running cscript without the //U switch as in this post without any luck as well.

I ended up placing nodejs.exe in the Ruby\bin folder and the issue was resolved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!