Calling Node.js script from Rails app using ExecJS

后端 未结 4 558
遥遥无期
遥遥无期 2021-01-04 11:57

I have a Rails application that needs to run a node script. I imagine that using the ExecJS gem is the cleanest way to run JavaScript from a Rails app. However, so far, Exec

4条回答
  •  别那么骄傲
    2021-01-04 12:36

    I'm not sure of the answer but maybe you need to precise the exec_js_runtime environment variable to be node.

    Something like ENV['EXECJS_RUNTIME'] = 'Node' You can try to put it in the config/boot.rb or just to define the EXECJS_RUNTIME in your environment, something like export EXECJS_RUNTIME=Node

    Hope it helps

提交回复
热议问题