Comments (4)
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.
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.
Doesn't this require initializing the vm first?
from ruby-sys.
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)
- Release 0.2.1? HOT 3
- Basic how-to documentation HOT 1
- Add rb_define_module_under extern.
- Not working with rust 13.0? HOT 6
- Consider bindgen HOT 13
- Use docs.rs HOT 2
- Consider building a Ruby if one doesn't exist
- Allow non-system rubies to be linked against via environment variable
- setting $RUBY_STATIC doesn't seem to generate a statically linked library HOT 10
- Publish a new version?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-sys.