Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use runtime because File.executable? returns false #106

Open
theo-bittencourt opened this issue Aug 18, 2021 · 5 comments
Open

Can't use runtime because File.executable? returns false #106

theo-bittencourt opened this issue Aug 18, 2021 · 5 comments

Comments

@theo-bittencourt
Copy link

theo-bittencourt commented Aug 18, 2021

Hey guys,

Something weird here. I'm getting the error below when trying to start the Docker container:

ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime.

After some debugging, I found a strange behavior on ExecJS::ExternalRuntime.locate_executable , where the File.executable?(full_path) is returning false, although the /usr/bin/node executable is present.

pry> File.stat('/usr/bin/node').owned?
=> true

pry(#<ExecJS::ExternalRuntime>)> File.executable?('/usr/bin/node')
=> false

pry(#<ExecJS::ExternalRuntime>)> File.file?('/usr/bin/node')
=> true

File.executable?(full_path) && File.file?(full_path)

== Stack ==
Docker
Ruby 2.7.4
ExecJS 2.8.1

@casperisfine
Copy link

Docker

Is this reproducible with a public image by any chance?

Also what does ls -lh /usr/bin/node; whoami look like?

@theo-bittencourt
Copy link
Author

Is this reproducible with a public image by any chance?

Not right now. :/

Also what does ls -lh /usr/bin/node; whoami look like?

bash-4.4# ls -lh /usr/bin/node; whoami
-rwxr-xr-x    1 root     root       21.1M Apr  1  2018 /usr/bin/node
root

@casperisfine
Copy link

Oh wow, that's a super weird one.

@casperisfine
Copy link

Not right now. :/

Can you maybe just share a reduced Dockerfile with just what is needed to install Ruby and Node? Should be doable without any private code.

@theo-bittencourt
Copy link
Author

For now, it worked by downgrading to Ruby 2.6.8 in the problematic machine (Ubuntu 16).

The minimal reproducible code I've created on my own machine (macOS) didn't raise any exception, even on Ruby 2.7.4.

https://github.com/theo-bittencourt/no_js_runtime_error_execjs

I've other machine with the same error too. It is not physically available right now, but when I connect to it again, I will try to bring more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants