[MacRuby-devel] Packing gems in the app's folder

Matt Aimonetti mattaimonetti at gmail.com
Fri Mar 27 10:49:57 PDT 2009


I agree with Eloy, I'm not using rubygems either. Just load manually what
you vendored.

- Matt

On Fri, Mar 27, 2009 at 10:20 AM, Eloy Duran <eloy.de.enige at gmail.com>wrote:

> Hi,
>
> Have you included the Gems directory in your xcode project so that it
> copies the complete dir when building?
> This probably then tells you that the dir does not exist "p
> File.exist?(File.expand_path('../Gems', __FILE__))".
>
> Second, are you sure you actually need rubygems if you are already
> vendoring? Removing rubygems from the dependencies will really boost up the
> load time of your application. So I would do everything to remove it as a
> dependency. In the best case scenario you only need to do something like
> (untested code):
>
> Dir.glob(File.expand_path('../Gems/*', __FILE__)).each do |gem|
>  $LOAD_PATH.unshift File.join(gem, 'lib')
> end
>
> require "mechanize"
>
> - Eloy
>
>
> On 27 mrt 2009, at 17:57, Thiago Jackiw wrote:
>
>  Do I have to do anything special to pack gems inside my application's
>> folder? The following isn't working when I require the gems inside of
>> my 'Gems' folder:
>>
>> # rb_main.rb
>> ENV['GEM_HOME'] = File.dirname(__FILE__) + '/Gems'
>> require 'rubygems'
>> require 'mechanize'
>>
>> `require': no such file to load -- mechanize (LoadError)
>>
>> If I do the above in IRB it works just fine.
>>
>> The 'Gems' folder contains the following structure:
>>
>> Gems
>> - cache
>> - doc
>> - gems
>>  - mechanize-0.9.2
>> - specifications
>>  - mechanize-0.9.2.gemspec
>>
>> Thanks, and I'm using MacRuby 0.4.
>>
>> --
>> Thiago Jackiw
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090327/270dd347/attachment.html>


More information about the MacRuby-devel mailing list