From: Leslie Viljoen Date: 2009-09-09T21:49:10+09:00 Subject: Re: ruby2exe On Fri, Sep 4, 2009 at 9:08 AM, Raveendran Perumalsamy wrote: > I am getting this error > > C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/require2lib.rb:60:in > `gat > herlibs': undefined method `list' for Gem::Specification:Class > (NoMethodError) I have fixed this in my own local copy of RubyScript2Exe because I can't get Ocra to work (my Ocra problem is here: http://rubyforge.org/forum/forum.php?thread_id=45617&forum_id=31710) If you need to get RubyScript2Exe working on Windows, do this: > c: > cd \ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3 > C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>ruby realstuff.rb --tar2rubyscript-justextract > C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>cd rubyscript2exe ... now make the changes mentioned below, then repackage with: > C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>tar2rubyscript rubyscript2exe realstuff.rb The changes needed are in require2lib.rb, line 60 onwards needs to be like so: #Gem::Specification.list.each do |gem| Gem.loaded_specs.each do |name, gem| #if gem.loaded? $stderr.puts "Found gem #{gem.name} (#{gem.version})." if VERBOSE fromdir = File.join(gem.installation_path, "specifications") todir = File.expand_path("rubyscript2exe.gems/specifications", LIBDIR) fromfile = File.join(fromdir, "#{gem.full_name}.gemspec") tofile = File.join(todir, "#{gem.full_name}.gemspec") File.copy(fromfile, tofile) fromdir = gem.full_gem_path todir = File.expand_path(File.join("rubyscript2exe.gems/gems", gem.full_name), LIBDIR) Dir.copy(fromdir, todir) Dir.find(todir).each do |file| if File.file?(file) gem.require_paths.each do |lib| unless lib.empty? lib = File.expand_path(lib, todir) lib = lib + "/" requireablefiles << file[lib.length..-1] if file =~ /^#{lib}/ end end end end #end end end ($" + LOADED).each do |req|