danielpclark / rutie

“The Tie Between Ruby and Rust.”
MIT License
939 stars 62 forks source link

Build script fails to locate Ruby #149

Open milgner opened 2 years ago

milgner commented 2 years ago

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:

Any hints welcome, of course :sweat_smile:

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 commented 2 years ago

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 commented 2 years ago

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.