Questions tagged [mruby]

mruby is the lightweight implementation of the Ruby language, that can compile to C source; it's intended to make Ruby constructs accessible for embedded systems development.

mruby is the lightweight implementation of the Ruby language complying to (part of) the ISO standard. mruby can be linked and embedded within your application. We provide the interpreter program "mruby" and the interactive mruby shell "mirb" as examples. You can also compile Ruby programs into compiled byte code using the mruby compiler "mrbc". All those tools reside in "bin" directory. The "mrbc" is also able to generate compiled byte code in a C source file. You can check the "mrbtest" program under the "test" directory.

37 questions
12
votes
4 answers

What are the major omissions in mruby compared to MRI?

I'm quite interested in the mruby project, but have had no luck in finding a summarization of the major omissions in mruby compared to other, more complete Ruby implementations (most importantly, MRI). The README in the project says that mruby…
grumbler
  • 886
  • 9
  • 20
9
votes
1 answer

How do I write h2o webserver mruby handlers for WordPress multisite?

This is what Apache needs. I like to know how I do this in h2o. RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond…
redanimalwar
  • 1,229
  • 1
  • 12
  • 32
3
votes
0 answers

How to setup rake to compile mruby gems?

I am trying to build the example gem from here following the mruby documentation for building gems. I'm on a Mac OS Catalina, and I have installed RVM to manage my installation mruby. Right now which ruby returns…
sunmat
  • 6,976
  • 3
  • 28
  • 44
3
votes
2 answers

Is it possible / easy to include some mruby in a nim application?

I'm currently trying to learn Nim (it's going slowly - can't devote much time to it). On the other hand, in the interests of getting some working code, I'd like to prototype out sections of a Nim app I'm working on in ruby. Since mruby allows…
user208769
  • 2,216
  • 1
  • 18
  • 27
3
votes
1 answer

reading the 'return' value of mruby program via C

I am facing an issue with calling of mruby VM in C. I could invoke the mruby vm and execute the ruby code from C. I could also trigger the methods defined in the ruby code as well. But I am facing issue while trying to read the return value of the…
programmer
  • 582
  • 2
  • 4
  • 16
3
votes
1 answer

Precompiling assets failed. Push rejected, failed to compile Ruby app

I'm new in rails and I have small project , when I push to heroku see this error Counting objects: 41, done. Delta compression using up to 4 threads. Compressing objects: 100% (26/26), done. Writing objects: 100% (26/26), 2.21 KiB | 0 bytes/s,…
AliOsm
  • 541
  • 2
  • 6
  • 20
3
votes
1 answer

How to raise errors/exceptions by default in mruby?

I'm getting started with mruby and found out the hard way that an error was occurring in my code, but there was no error reporting. Maybe I am doing something wrong. How can I get errors to appear when they occur? Excerpt from C code: mrb =…
Andrew
  • 227,796
  • 193
  • 515
  • 708
3
votes
0 answers

Compiling mruby for STM32F407 cortex-m4 target

I'm trying to compile mruby for the STM32F407 cortex-m4 target, but i get the following error when running ./minirake in the repo directory: Command Failed: ["/home/eugenio/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-ld" -T…
fuzzy
  • 31
  • 2
2
votes
0 answers

How can I make a C pointer wait if called from a different thread, but work in a callback?

I'm trying to implement a thread-safe version of an mruby Rust binding. mruby has a *mut MRState (a wrapper over mrb_state). You need to pass this *mut MRState when running mruby code. The mruby code has a Rust callback that it can call where it…
dragostis
  • 2,574
  • 2
  • 20
  • 39
2
votes
1 answer

Writing a custom IRB

I'm playing around with all sorts of small hardware. In an attempt to learn it. I would like to run mruby. I've compiled for my hardware. And have the framework as well as the include MIRB and MRUBY bins. But I would potentially like the code my…
csduarte
  • 191
  • 1
  • 1
  • 9
2
votes
1 answer

mruby issue with require and require_relative

I am trying my hand on with mRuby. I compiled the mRuby source locally. I tried this simple example: inc.rb def test(a, b) print "Inside the include->test(..)" return a+b end test1.rb require_relative 'inc.rb' def helloworld(var1) …
programmer
  • 582
  • 2
  • 4
  • 16
2
votes
1 answer

Compile Contiki application with MRuby

I am trying to compile a Contiki application that includes MRuby libraries and executes some simple ruby code. The problem is, I don't know how to include the MRuby libraries in the compilation. Here is the project:…
2
votes
1 answer

How to pass a C string to a Ruby method using mruby?

I am getting started with C and mruby. I have a program that calls to a Ruby function using the mruby mrb_load_string function. I want to pass the argument from the C function to the Ruby function. How can I achieve this? void on_key(const char…
Andrew
  • 227,796
  • 193
  • 515
  • 708
2
votes
3 answers

How to load mruby code from external file in C program?

I'm getting started with mruby. I'm also pretty new to programming in C, so I may not be familiar with many of the basics. I was able to compile the example mruby program which loads the ruby code from a string. Now I would like to load it from an…
Andrew
  • 227,796
  • 193
  • 515
  • 708
2
votes
1 answer

How to compile an mruby example?

Hearing about mruby has inspired me to start learning C programming. I have worked through a few tutorials online so I understand the basics, but now I would like to start playing with mruby by compiling an example application. I understand how to…
Andrew
  • 227,796
  • 193
  • 515
  • 708
1
2 3