Last updated November 04, 2009 22:51, by dkoontz
Feedicon  

Problem: Libraries you are using load RubyGems and that subsequently causes libraries you've unpacked into your project fail to load.

Solution: Prevent the real RubyGems from loading as it won't be able to work anyway inside a packaged jar file. This can be done by loading your own rubygems.rb file that contains a "fake" RubyGems class and a few other methods needed to emulate the RubyGems interface.

 Object.send(:remove_const, :Gem) if Object.const_defined? :Gem
 Kernel.send(:remove_method, :gem) if Kernel.respond_to? :gem
 
 module Gem
 end
 
 module Kernel
   def gem(*args); end
 end
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close