Trouble with on gem in rubyscript2exe

Greetings

I’m using rubyscript2exe to build and distribute .exe versions of my
Ruby-programs at my office.

In one of my programs I use my own gem:

require 'expanded_date'

this gem is built and installed successfully on my computer.

This causes a peculiar problem with rubyscript2exe.

Other gems work nicely, so I think my ‘expanded_date’ gem is somehow
erroneous. The thing is it works like a charm when used in ruby
'natively
(i.e. not throug rubyscript2exe), and it also works like a charm when
used
directly (i.e. not as an installed gem, just as a required ‘.rb’ file).

The problem is when using as a gem and rubyscript2exe.

I’m kind of puzzled. Any tips?


Gemspec

require ‘rubygems’
spec = Gem::Specification.new

spec.name = ‘expanded_date’
spec.version = ‘0.1.0’
spec.platform = Gem::Platform::RUBY
spec.summary = ‘Adds extra functionality to date’
spec.require_path = ‘.’

spec.files = [‘expanded_date.rb’]


Error message when running the .exe version of my rubyscript

D:/DOCUME~1/JON-EG~1.WMM/LOCALS~1/Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:27:in
gem_original_require': no such file to load -- fileutils (LoadError) from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:27:inrequire’
from D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems.rb:433:in
ensure_gem_subdirectories' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems.rb:430:inensure_gem_subdirectories’
from D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems.rb:355:in
set_home' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems.rb:121:indir’
from D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems.rb:362:in
set_paths' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems.rb:131:inpath’
from
D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems/source_index.rb:60:in
installed_spec_directories' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems/source_index.rb:47:infrom_installed_gems’
from D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems.rb:109:in
source_index' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:111:ininit_gemspecs’
from
D:/DOCUME~1/…/Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:56:in
initialize' from D:/DOCUME~1/.../Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:30:inrequire’
from D:\DOCUME~1…\Temp\eee.xls2csv.exe.2\app\xls2csv.rb:1
from D:\DOCUME~1…\Temp\eee.xls2csv.exe.2\bootstrap.rb:45


Ruby version

ruby 1.8.4 (2006-04-14) [i386-mswin32]

D:/DOCUME~1/JON-EG~1.WMM/LOCALS~1/Temp/eee.xls2csv.exe.2/lib/rubygems/custom_require.rb:27:in
`gem_original_require’: no such file to load – fileutils
(LoadError)

I’m aware of this problem. I mentioned it before on this list.
See my post and Eric’s reactions.

“Perhaps sqlite-ruby is an old format gem?” True?

The workaround is easy: require fileutils in your library.

gegroet,
Erik V. - http://www.erikveen.dds.nl/

[1] http://tinyurl.com/enofd

The workaround is easy: require fileutils in your library.

Brilliant. Works nicely. Thank your for your speedy reply.

Best wishes
JE

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs