pub fn activate() -> Result<RbEnv, Box<dyn Error>>Expand description
Configures Cargo linking based on the DEP_RB_* environment variables. This
is needed to ensure that Cargo properly links to libruby on Windows..
ⓘ
// In your crate's build.rs
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let rb_env = rb_sys_env::activate()?;
if rb_env.ruby_major_minor() < (2, 7) {
panic!("Your Ruby version is EOL!");
}
Ok(())
}
// In your crate's lib.rs
pub fn is_ruby_flonum_activated() -> bool {
cfg!(ruby_use_flonum)
}