# Error when running an exe created with rubyscript2exe

**URL:** <https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575>\
**Category:** Ruby\
**Created:** [September 3, 2008, 9:35am UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575 "2008-09-03T09:35:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshgpai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@rakeshgpai](https://www.ruby-forum.com/u/rakeshgpai)\
**Post date:** [September 3, 2008, 9:35am UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575/1 "2008-09-03T09:35:31Z")

</div>

I am getting the following error when i created an exe from a ruby  
script. Has any got any idea why this comes?

Thanks,  
Rakesh

C:/Users/Pi/eee/eee.livequote1.exe.3/lib/rubygems/custom\_require.rb:27:in  
`gem_o riginal_require': no such file to load -- tempfile (LoadError) from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/rubygems/custom_require.rb :27:in`require’  
from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/open-uri.rb:302:in  
`<<' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/open-uri.rb:259:in`open\_h  
ttp’  
from  
C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:381:in `ca ll_block' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:372:in`\<\<  
’  
from  
C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:88:in `rea d' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/http.rb:2221:in`read\_  
body\_0’  
from  
C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/http.rb:2182:in `read_ body' ... 16 levels... from C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61:in`each’

```
    from C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61
    from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77:in

```

`load’  
from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77

---

<div class="post-metadata">

**Author:** ![rakeshgpai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@rakeshgpai](https://www.ruby-forum.com/u/rakeshgpai)\
**Post date:** [September 3, 2008, 1:37pm UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575/2 "2008-09-03T13:37:45Z")

</div>

-------- Original-Nachricht --------

> Datum: Wed, 3 Sep 2008 16:30:00 +0900  
> Von: Rakesh P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: Error when running an exe created with rubyscript2exe

> ```
> from
> from
> 
> ```
> 
> body’  
> … 16 levels…  
> from  
> C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61:in `each’
> 
> ```
> from C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61
> from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77:in
> 
> ```
> 
> ## `load’ from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Dear Rakesh,

the script you are executing cannot find a gem or a file “tempfile”.  
This might be because the latter is not there, or cannot be found ( due  
to a path  
issue).

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![rakeshgpai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@rakeshgpai](https://www.ruby-forum.com/u/rakeshgpai)\
**Post date:** [September 5, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575/3 "2008-09-05T20:28:14Z")

</div>

Rakesh P. wrote:

> I am getting the following error when i created an exe from a ruby  
> script. Has any got any idea why this comes?
> 
> Thanks,  
> Rakesh
> 
> C:/Users/Pi/eee/eee.livequote1.exe.3/lib/rubygems/custom\_require.rb:27:in  
> `gem_o riginal_require': no such file to load -- tempfile (LoadError) from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/rubygems/custom_require.rb :27:in`require’  
> from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/open-uri.rb:302:in  
> `<<' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/open-uri.rb:259:in`open\_h  
> ttp’  
> from  
> C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:381:in `ca ll_block' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:372:in`\<\<  
> ’  
> from  
> C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/protocol.rb:88:in `rea d' from C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/http.rb:2221:in`read\_  
> body\_0’  
> from  
> C:/Users/Pi/eee/eee.livequote1.exe.3/lib/net/http.rb:2182:in `read_ body' ... 16 levels... from C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61:in`each’
> 
> ```
> from C:\Users\Pi\eee\eee.livequote1.exe.3\app\livequote1.rb:61
> from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77:in
> 
> ```
> 
> `load’  
> from C:\Users\Pi\eee\eee.livequote1.exe.3\bootstrap.rb:77

You need to “require” any gem that are required by a gem that you did  
required.

For example: watir requires win32ole and activesupport  
normally you would not specifically require win32ole and activesupport

but you do if you want to create an “exec” program with rubyscript2exe

Hope that helps

---

<div class="post-metadata">

**Author:** ![rakeshgpai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@rakeshgpai](https://www.ruby-forum.com/u/rakeshgpai)\
**Post date:** [September 8, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575/4 "2008-09-08T21:18:45Z")

</div>

Erik V. wrote:

> RubyScript2Exe and RubyGems 1.2.0 don’t play very well together:
> 
> [http://groups.google.com/group/ruby-talk-google/browse\_frm/thread/f922ec9ef52af7e4](http://groups.google.com/group/ruby-talk-google/browse_frm/thread/f922ec9ef52af7e4)  
> [http://rubyforge.org//tracker/index.php?func=detail&aid=21467&group\_id=126&atid=575](http://rubyforge.org//tracker/index.php?func=detail&aid=21467&group_id=126&atid=575)
> 
> Add “require ‘rubygems’” _in_ your application and temporarily  
> remove rubygems from RUBYOPT before compiling:
> 
> $ RUBYOPT= ruby rubyscript2exe.rb test.rb
> 
> Or:
> 
> C:\> unset RUBYOPT  
> C:\> ruby rubyscript2exe.rb test.rb
> 
> That seems to work. At least, on my machine…
> 
> gegroet,  
> Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

Thanks for the help guys.  
It seems there is some problem with RubyScript2Exe as Erik mentioed. I  
am still getting ther error when i create the exe with the command “ruby  
rubyscript2exe.rb test.rb”. But when i installed gem install  
rubyscript2exe.rb and then converted it to exe by giving ‘rubyscript2exe  
test.rb’ the exe is working properly. I am kind of novice in ruby, so  
not sure if i missed anything trivial earlier .

Best Regards,  
Rakesh

---

<div class="post-metadata">

**Author:** ![rakeshgpai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@rakeshgpai](https://www.ruby-forum.com/u/rakeshgpai)\
**Post date:** [September 6, 2008, 10:12am UTC](https://www.ruby-forum.com/t/error-when-running-an-exe-created-with-rubyscript2exe/147575/5 "2008-09-06T10:12:12Z")

</div>

RubyScript2Exe and RubyGems 1.2.0 don’t play very well together:

[http://groups.google.com/group/ruby-talk-google/browse\_frm/thread/f922ec9ef52af7e4](http://groups.google.com/group/ruby-talk-google/browse_frm/thread/f922ec9ef52af7e4)  
[http://rubyforge.org//tracker/index.php?func=detail&aid=21467&group\_id=126&atid=575](http://rubyforge.org//tracker/index.php?func=detail&aid=21467&group_id=126&atid=575)

Add “require ‘rubygems’” _in_ your application and temporarily  
remove rubygems from RUBYOPT before compiling:

$ RUBYOPT= ruby rubyscript2exe.rb test.rb

Or:

C:\> unset RUBYOPT  
C:\> ruby rubyscript2exe.rb test.rb

That seems to work. At least, on my machine…

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)
