Using Gems with MacRuby
Yehuda Katz gem bundler is a very good option IMHO:
http://github.com/wycats/bundler
Anyway, there are many other options such as creating a vendor/ directory in your app bundle adding each vendor subdir to the ruby library search path in rb_main.rb
:
$:.unshift File.join(File.dirname(__FILE__), 'vendor/rest-client/lib')$:.unshift File.join(File.dirname(__FILE__), 'vendor/crack/lib')require 'rest-client'require 'crack'
I'm using the latter approach here:
If you're packaging a MacRuby application you can also add the --gem
flag with macruby_deploy
under the "Info" tab for your Deployment target.
This puts the specified gem in the site_ruby folder deep within your package.
The arguments I'm passing macruby_deploy for my app are:
--compile --embed --gem sequel --gem sqlite3