javascript_include_tag throws unsupported method

后端 未结 3 1035
天涯浪人
天涯浪人 2020-12-11 08:17

I recently created a new project with Rails 4.2.0 and created a controller called Land for the landing page. So, I ran into this error upon visting http:/

相关标签:
3条回答
  • 2020-12-11 08:31

    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.

    0 讨论(0)
  • 2020-12-11 08:46

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

    0 讨论(0)
  • 2020-12-11 08:48

    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.

    0 讨论(0)
提交回复
热议问题