mruby

mruby-require error: NoMethodError: undefined method 'puts' for main

眉间皱痕 提交于 2019-12-25 04:33:30
问题 I managed to compile the mruby code adding the mrubygem - mruby-require from https://github.com/mattn/mruby-require However when I try to call the require './' I get an error. Below is my code: inc.rb def test(a, b) print "Inside the include->test(..)" return a+b end test1.rb require 'inc.rb' def helloworld(var1) print 'hello world ' + var1 + ". Test number = " + test(4, 5) end helloworld('test') When I execute test1.rb I get this error from mruby: NoMethodError: undefined method 'puts' for

How to compile an mruby example?

流过昼夜 提交于 2019-12-13 01:56:45
问题 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 compile a single C file, but I'm stuck at trying to figure out how to also compile mruby along with my own code. I'm using GCC on Mac OS X 10.8. Using this example: #include <stdlib.h> #include <stdio.h> #include <mruby.h> #include <mruby/compile.h>

mruby issue with require and require_relative

我是研究僧i 提交于 2019-12-11 12:34:49
问题 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) print 'hello world ' + var1 + ". Test number = " + test(4, 5) end helloworld('test') test2.rb require 'inc.rb' def helloworld(var1) print 'hello world ' + var1 + ". Test number = " + test(4, 5) end helloworld('test') I executed both the test programs using mruby.