From 3ac907fcc2fda7d38002c42990b02fda7c58da6c Mon Sep 17 00:00:00 2001 From: Ralph Desir Date: Sun, 24 May 2015 23:44:37 -0400 Subject: [PATCH] I noticed nobody had written how to add gems in the wiki so I just wrote it in myself. There is still more information to be added but this is what I learned so I'm sharing, --- Mrbgems-FAQ.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Mrbgems-FAQ.md b/Mrbgems-FAQ.md index 3978065..23ae2c7 100644 --- a/Mrbgems-FAQ.md +++ b/Mrbgems-FAQ.md @@ -9,8 +9,32 @@ In detail, see https://github.com/mruby/mruby/blob/master/doc/mrbgems/README.md ## How to add mrbgems? -(To be written...) - +In mrubys root directory there is a file called build_config.rb that file is where you have your build information. Including the gems you want to add as well as additional information such as included header +files and libraries to be linked if your creating your gem with C extensions. Inside the build_config.rb +You can add this code in to add in your gems. +```ruby +conf.gem 'path\to\gem' +``` +If you want to include an include path you do it by writing the code below in your gem specification inside +your projects mrbgem.rake file. +```ruby +conf.cc do |cc| + cc.include_paths = '' +end +``` +Or you may run into a problem where the mruby.h can't be found in that case do this. +```ruby +conf.cc do |cc| + cc.include_paths = ['path\to\mruby\include', 'path\to\your\include'] +end +``` +Now if you want to link files you do so like this. +```ruby +spec.linker do |linker| + linker.library_paths = 'path\to\lib' + linker.libraries = ['mingw32', 'foo', 'bar'] + end +``` ## Help! My mruby don't have... ### Kernel#sleep