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

Build script fails to locate Ruby #149

Open
milgner opened this issue Aug 7, 2021 · 2 comments
Open

Build script fails to locate Ruby #149

milgner opened this issue Aug 7, 2021 · 2 comments
Labels

Comments

@milgner
Copy link

milgner commented Aug 7, 2021

Running in an environment that uses asdf (similar to RVM) to manage multiple Ruby versions, the build script fails to locate ruby.

The corresponding error message is

Couldn't find a valid value for RbConfig::CONFIG['ENABLE_SHARED']

but the real reason is that executing ruby fails so the code cannot be evaluated at all.

I'm a bloody noob when it comes to Rust, but I'll try to improve this.
Two things come to mind:

  • improve error message to indicate that Ruby wasn't found
  • run command in the context of the parent shell to use its PATH

Any hints welcome, of course 😅

I did find the workaround of setting the RUBY environment variable to the full path of the executable which makes my build work, but I feel like this would be helpful for other users.

@milgner
Copy link
Author

milgner commented Aug 9, 2021

Did some reading up on this and realized that Command::new is already supposed to check PATH for the executable as defined by the OS. Also checked the output of PATH during the build script and it looks fine too, so the environment does get inherited correctly.
Additional investigation is needed on why ruby cannot be found on my system.

@danielpclark
Copy link
Owner

Thanks for sharing this info. I've never used asdf. I'm glad you found a workaround. I'm not sure how to go about solving that without first reproducing the issue which means I'll need to have what you have set up set up here locally.

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

No branches or pull requests

2 participants