Compiling ruby-ole gem problem

  3 posts   Feedicon  
Replies: 2 - Last Post: January 07, 2010 21:07
by: grzesieq
showing 1 - 3 of 3
 
Posted: January 07, 2010 09:58 by grzesieq
Hi,

I need to compile my app to a single jar, and I need to use the spreadsheet gem in it. spreadsheet requires ruby-ole, and I unpacked both gems in lib/ruby.

The process of creating the jar works fine, but when I execute the program, it crashes with the following message:
Errno::ENOENT - No such file or directory - File not found - 
file:/{redacted ;)}/package/jar/AccountTool.jar!/ruby_minus_ole_minus_1_dot_2_dot_10/lib/ole/types/../../../data/propids.yaml
yaml:144:in `initialize'
yaml:144:in `open'
yaml:144:in `load_file'
lib/ruby/ruby-ole-1.2.10/lib/ole/types/property_set.rb:26:in `require'
lib/ruby/ruby-ole-1.2.10/lib/ole/types.rb:2:in `require'

The problematic code is:
DATA = YAML.load_file(File.dirname(__FILE__) + '/../../../data/propids.yaml').
  inject({}) { |hash, (key, value)| hash.update Clsid.parse(key) => value }

Is there any way to make it possible to execute, or should I just fix it by hard-coding the yaml file into the ruby file as a string?

tia,
Grzesiek
 
Posted: January 07, 2010 19:10 by Logan Barnett

Grzesiek Is the problematic code part of the gem or part of your code?

The biggest thing that stands out to me is the the fact that you have .. without using File.expand_path around the path. This has bit me a lot in the past when I wanted to reach back relatively in the path structure.

Let us know if it works!

-Logan

 
Posted: January 07, 2010 21:07 by grzesieq
It was in the gem. I needed a quick fix so I just put the data from the file into the constant as a hash.
Replies: 2 - Last Post: January 07, 2010 21:07
by: grzesieq
  • 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