Giter VIP home page Giter VIP logo

Comments (4)

steveklabnik avatar steveklabnik commented on June 28, 2024

Hm, it's not obvious to me what this would be off the top of my head; I'll have to dig in but it might take me a few days, sorry :/

from ruby-sys.

wshatch avatar wshatch commented on June 28, 2024

No problem, thanks for looking into it! Also, I realized I was using an old version of ruby (compiled without proper chruby version). Not sure if it helps, but here's cargo run --verbose with ruby 2.3.0.

   Compiling libc v0.2.14
     Running `rustc /Users/william/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.14/src/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"use_std\" --cfg feature=\"default\" -C metadata=1f3392fe1afd1313 -C extra-filename=-1f3392fe1afd1313 --out-dir /Users/william/code/test_ruru/target/debug/deps --emit=dep-info,link -L dependency=/Users/william/code/test_ruru/target/debug/deps -L dependency=/Users/william/code/test_ruru/target/debug/deps --cap-lints allow`
   Compiling ruby-sys v0.2.6
     Running `rustc /Users/william/.cargo/registry/src/github.com-1ecc6299db9ec823/ruby-sys-0.2.6/build.rs --crate-name build_script_build --crate-type bin -g --cfg feature=\"default\" --out-dir /Users/william/code/test_ruru/target/debug/build/ruby-sys-63f7f6f801106a0a --emit=dep-info,link -L dependency=/Users/william/code/test_ruru/target/debug/deps -L dependency=/Users/william/code/test_ruru/target/debug/deps --cap-lints allow`
     Running `/Users/william/code/test_ruru/target/debug/build/ruby-sys-63f7f6f801106a0a/build-script-build`
     Running `rustc /Users/william/.cargo/registry/src/github.com-1ecc6299db9ec823/ruby-sys-0.2.6/src/lib.rs --crate-name ruby_sys --crate-type lib -g --cfg feature=\"default\" -C metadata=6948a09fc5cf7b2c -C extra-filename=-6948a09fc5cf7b2c --out-dir /Users/william/code/test_ruru/target/debug/deps --emit=dep-info,link -L dependency=/Users/william/code/test_ruru/target/debug/deps -L dependency=/Users/william/code/test_ruru/target/debug/deps --extern libc=/Users/william/code/test_ruru/target/debug/deps/liblibc-1f3392fe1afd1313.rlib --cap-lints allow -L /Users/william/.rubies/ruby-2.3.0/lib -l dylib=ruby.2.3.0`
   Compiling test_ruru v0.1.0 (file:///Users/william/code/test_ruru)
     Running `rustc src/main.rs --crate-name test_ruru --crate-type bin -g --out-dir /Users/william/code/test_ruru/target/debug --emit=dep-info,link -L dependency=/Users/william/code/test_ruru/target/debug -L dependency=/Users/william/code/test_ruru/target/debug/deps --extern ruby_sys=/Users/william/code/test_ruru/target/debug/deps/libruby_sys-6948a09fc5cf7b2c.rlib -L /Users/william/.rubies/ruby-2.3.0/lib`
src/main.rs:6:9: 6:12 warning: unused variable: `foo`, #[warn(unused_variables)] on by default
src/main.rs:6     let foo = array::rb_ary_new();
                      ^~~
     Running `target/debug/test_ruru`
error: Process didn't exit successfully: `target/debug/test_ruru` (signal: 11, SIGSEGV: invalid memory reference)

from ruby-sys.

Ryman avatar Ryman commented on June 28, 2024

Doesn't this require initializing the vm first?

from ruby-sys.

wshatch avatar wshatch commented on June 28, 2024

Yep, changed the code to

extern crate ruby_sys;
use ruby_sys::vm;
use ruby_sys::array;

fn main() {
  unsafe{
    vm::ruby_init();
    let foo = array::rb_ary_new();
  }
}

from ruby-sys.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.