load

Function load 

Source
pub fn load() -> Result<RbEnv, Box<dyn Error>>
Expand description

Loads the DEP_RB_* environment variables, without setting Cargo configuration.

Note: This will not activate the rb-sys crate’s features to ensure Ruby is properly linked.

// In your crate's build.rs

pub fn main() -> Result<(), Box<dyn std::error::Error>> {
    let rb_env = rb_sys_env::load()?;

    rb_env.print_cargo_rerun_if_changed();
    rb_env.print_cargo_rustc_cfg();
    rb_env.print_encoded_cargo_args();

    if rb_env.ruby_major_minor() < (2, 7) {
        panic!("Your Ruby version is EOL!");
    }

    Ok(())
}