Rubyscript2exe FileUtils error

C

conker

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 method
`commands' for class `Module' (NameError)
from c:/ruby/lib/ruby/1.8/fileutils.rb:1518
from c:/ruby/lib/ruby/1.8/fileutils.rb:1517:in `each'
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:in
`require'
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!
 
M

Mike Harris

conker said:
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.
 
M

Mike Harris

conker said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top