1

Unable to start PAT Local Server

There are several of us at my firm that have been unable to initiate the Parametric Analysis Tool local server for the past 1-2 months. We have never had an issue with the tool prior to this.

I have worked through every step in this post to no avail: What do I do about a "Server Error" in PAT 2.0.0?

We are all receiving the following error from the rails.log file: "/Applications/OpenStudio-2.9.1/ParametricAnalysisTool.app/Contents/Resources/OpenStudio-server/gems/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)"

We are all using Apple MacBooks and have replicated this issue on at least OS V2.7, 2.8, 2.9, & 2.9.1. The sudden onset makes me think this is associated with an update or change to the Apple JavaScriptCore .

Any assistance would be much appreciated.

jt1234's avatar
331
jt1234
asked 2020-04-29 18:59:06 -0500
shorowit's avatar
11.8k
shorowit
updated 2020-04-30 10:22:36 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Can you try OpenStudio v3.0, which was just recently released?

shorowit's avatar shorowit (2020-04-30 11:52:40 -0500) edit

Same result with V3.0.

jt1234's avatar jt1234 (2020-04-30 15:17:58 -0500) edit

Could you run this in a terminal (you may need to install execjs gem) ruby -r execjs -e 'puts ExecJS.runtime.name'

On my machine, I get the following output.

Tims-MBP-2:~ tijcolem$ ruby -r execjs -e 'puts ExecJS.runtime.name' Node.js (V8)

If you get the same error as PAT, you could try and install node.js. If you have homebrew you can do install it via brew install nodeor you can just download the installer https://nodejs.org/en/download/.

Not sure if that'll fix it. It may also be due to some security restrictions preventing PAT from exec on the JavaScriptVM.

tijcolem's avatar tijcolem (2020-04-30 19:28:22 -0500) edit

After doing some investigative work, it appears the issue comes about after upgrading to macOS Catalina. The PAT still works fine in all earlier macOS versions.

I get the following message when I run that line item in Terminal: 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire': cannot load such file -- execjs (LoadError)

I tried installing node.js with no success

jt1234's avatar jt1234 (2020-05-01 12:17:59 -0500) edit

It appears an issue had already been opened up about this. https://github.com/rails/execjs/issue... Hopefully, it'll be addressed in the next release.

tijcolem's avatar tijcolem (2020-05-07 18:23:19 -0500) edit
add a comment see more comments

1 Answer

1

We found a temporary solution, but it looks like this issue is driven by an incorrect JavaScripCore file reference in the runtimes.rb file. I have not cross-checked by I would imagine the location of file changed at the onset of macOS Catalina or during one the iterative updates.

The original rubtimes.rb line item reads:

JavaScriptCore = ExternalRuntime.new( name: "JavaScriptCore", command: "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", runner_path: ExecJS.root + "/support/jsc_runner.js"

but should be changed to:

JavaScriptCore = ExternalRuntime.new( name: "JavaScriptCore", command: "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Helpers/jsc", runner_path: ExecJS.root + "/support/jsc_runner.js"

jt1234's avatar
331
jt1234
answered 2020-05-01 14:09:11 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments