Rubyscript2exe FileUtils error

Hi, I am having trouble with rubyscript2exe when FileUtils is in my
script. The error is easily reproducible:

require “FileUtils”
puts “Hello World”

The error is:

ruby>ruby rubyscript2exe.rb hello.rb --rubyscript2exe-verbose
Tracing hello …
Hello World
Gathering files…
c:/ruby/lib/ruby/1.8/fileutils.rb:93: warning: already initialized
constant OPT_TABLE
c:/ruby/lib/ruby/1.8/fileutils.rb:1147: warning: already initialized
constant S_IF_DOOR
c:/ruby/lib/ruby/1.8/fileutils.rb:1448: warning: already initialized
constant METHODS
c:/ruby/lib/ruby/1.8/fileutils.rb:1518:in public': undefined methodcommands’ for class Module' (NameError) from c:/ruby/lib/ruby/1.8/fileutils.rb:1518 from c:/ruby/lib/ruby/1.8/fileutils.rb:1517:ineach’
from c:/ruby/lib/ruby/1.8/fileutils.rb:1517
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from
C:/DOCUME~1/HAI-PI~1/LOCALS~1/Temp/tar2rubyscript.d.5640.1/rubyscript2exe/require2lib.rb:51:in
`gatherlibs’

    from

C:/DOCUME~1/HAI-PI~1/LOCALS~1/Temp/tar2rubyscript.d.5640.1/rubyscript2exe/require2lib.rb:29
from hello.rb:2
Couldn’t execute this command (rc=0):

Help? Thanks!

conker wrote:

Hi, I am having trouble with rubyscript2exe when FileUtils is in my
script. The error is easily reproducible:

require “FileUtils”
puts “Hello World”

require ‘fileutils’ instead. Fixed the problem for me.

That did it!

Thanks for the prompt reply and easy fix!

conker wrote:

Hi, I am having trouble with rubyscript2exe when FileUtils is in my
script. The error is easily reproducible:

require “FileUtils”
puts “Hello World”

RubyScript2EXE does this:

require “fileutils”

If you require FileUtils in a different case, it gets required again by
RubyScript2EXE, fileutils.rb gets loaded twice, which causes the
problem.

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