# Re: Trouble running 'rubyscript2exe' for compiling my code

**URL:** <https://www.ruby-forum.com/t/re-trouble-running-rubyscript2exe-for-compiling-my-code/153660>\
**Category:** Ruby\
**Created:** [November 19, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/re-trouble-running-rubyscript2exe-for-compiling-my-code/153660 "2008-11-19T21:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Lyles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c6cbf5/32.png) [@Jacob\_Lyles](https://www.ruby-forum.com/u/Jacob_Lyles)\
**Post date:** [November 19, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/re-trouble-running-rubyscript2exe-for-compiling-my-code/153660/1 "2008-11-19T21:46:28Z")

</div>

I’m also trying to solve the dreaded (RC=256) error when I try to  
compile using Rubyscript2exe.

As I understand the problem, Ruby has an imposed limit of 256  
characters for commands passed to Ruby (Tell me if my understanding is  
incorrect).

With the circular dependencies problem mentioned previously  
[https://groups.google.com/group/ruby-talk-google/browse\_frm/thread/f922ec9ef52af7e4?tvc=1](https://groups.google.com/group/ruby-talk-google/browse_frm/thread/f922ec9ef52af7e4?tvc=1),  
rubygems unnecessarily bulks up the Rubyscript2exe compile command  
with repeated requires which cause the compile to fail.

I have require “rubygems” as the first line of my init.rb.

I’ve also tried the “set RUYBOPT=” command (Yes, Eric this works to  
unset RUYBOPT on Windows).

## I’ve added

## if ENV[‘RUBYOPT’] and defined? Gem then ENV.delete ‘RUBYOPT’ end

to the beginning of init.rb (Just before require ‘rubygems’ )

I also tried moving my files further up the directory tree (closer to  
root-closer to C:\ for you Windows users) so that the paths to the  
files I require are shorter.

But, I’m still unable to compile my app (HelloWorld _does_ compile  
since it’s much simpler than my app)

On Aug 1, 2:54 pm, “Erik V.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Question: Is it possible to investigate the exact order in which  
> libraries are required correctly?

## My latest attempt was to try to track down the order of the requires in my app to see exactly where the repeated requires are being made (and in what order). For this, I turned to a snibbit of code via [http://snippets.dzone.com/posts/show/6237](http://snippets.dzone.com/posts/show/6237):

require ‘logger’

## class Object def require(file\_name) output = “requiring #{file\_name}” puts output log = Logger.new(File.join(File.dirname( **FILE** ), ‘required.log’)) log.debug(output) super end end

This spits out a list of 250 calls to requires for my app.  
Consolidating and eliminating the repeats, this should actually be 188  
and eliminating the calls to modules within requires (like requiring  
date/format when date has already been called), further reduces the  
_actual_ requires to 43 for my app. A quick test of a “HelloWorld”  
with requires of Rubygems, logger, and rubyscript2exe has 4 requires  
with one repeat.

Obviously, this taly doesn’t include whatever is required by rubygems  
itself and logger before the actual logging kicks in.

Now, my next question is: Where do I/we go from here?

Is there a way to capture and slim down the command passed off to ruby  
to gather up the requires for rubyscript2exe (eliminating  
redundancies)?

Or does someone else have another idea?

Thanks,

Jacob
