Why is the gem `therubyracer` commented out by default in Gemfile?

后端 未结 1 1404
我在风中等你
我在风中等你 2021-02-05 13:24

I created a rails application, and tried to start the rails server. I got following error:

/home/ritesh/.rvm/gems/ruby-1.9.3-p429/gems/execjs-2.0.1/lib/execjs/ru         


        
1条回答
  •  北海茫月
    2021-02-05 13:52

    Because if another JavaScript runtime (like Node.js) is installed on the machine, Rails can use that, and therubyracer is not required.

    Rails uses ExecJS to load a JavaScript runtime. For more information on ExecJS, see its Github page: https://github.com/sstephenson/execjs. The readme provides a list of usable runtimes (as your error log notes).

    Depending on your deployment process and your production environment, it may not really matter which JavaScript runtime you use. Some people have issues with the size of the therubyracer library (see Rails - Could not find a JavaScript runtime?), and it may not be smart to install it on your production server.

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