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,

Ralph Desir
2015-05-24 23:44:37 -04:00
parent 8924488393
commit 3ac907fcc2
+26 -2
@@ -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