# Getting unexpected return (LocalJumpError) Rubyscript2exe

**URL:** <https://www.ruby-forum.com/t/getting-unexpected-return-localjumperror-rubyscript2exe/81165>\
**Category:** Ruby\
**Created:** [January 5, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/getting-unexpected-return-localjumperror-rubyscript2exe/81165 "2007-01-05T16:42:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericrchr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@ericrchr](https://www.ruby-forum.com/u/ericrchr)\
**Post date:** [January 5, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/getting-unexpected-return-localjumperror-rubyscript2exe/81165/1 "2007-01-05T16:42:57Z")

</div>

Hi,  
When running Rubyscript2exe on my .rb application. I get and unexpected  
return (LocalJumpError). But works fine when I do ruby app.rb.

The only thing on that line is return 0;  
Is this normal ? If not. anyone knows how to fix it ?

Thanks!

---

<div class="post-metadata">

**Author:** ![ericrchr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@ericrchr](https://www.ruby-forum.com/u/ericrchr)\
**Post date:** [January 5, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/getting-unexpected-return-localjumperror-rubyscript2exe/81165/2 "2007-01-05T17:11:30Z")

</div>

Eric Chiasson wrote:

> Hi,  
> When running Rubyscript2exe on my .rb application. I get and unexpected  
> return (LocalJumpError). But works fine when I do ruby app.rb.
> 
> The only thing on that line is return 0;  
> Is this normal ? If not. anyone knows how to fix it ?
> 
> Thanks!

I continued reading the Ruby Documentation and used exit(int) instead of  
return and it works great!

My code did not use any functions. So I now assume return is for  
functions and exit is to return to any calling application

Thanks to anyone who took the time to read it.
