# Launching a standalone Rails app

**URL:** <https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788>\
**Category:** Rails\
**Created:** [February 14, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788 "2006-02-14T15:24:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/1 "2006-02-14T15:24:35Z")

</div>

Hi,

I’ve developed a standalone Rails app - using tar2rubyscript and  
rubyscript2exe. The users aren’t going to understand that the’ll need to  
open the browser and go to 127.0.0.1:3000 to view the app, after running  
the exe.

I am wondering whether other people have tackled this problem in the  
past, and how they went about solving it.

One way would be to write a ruby script to run the exe … parse the  
results and once WEBrick has started off launch the default browser with  
127.0.0.1:3000.  
This would have to be multi-threaded though … not sure if this is  
possible or not, and whether I can run shell commands from within ruby  
(on XP)

Another solution would be to write something similar in C#. But that  
would involve VisualStudio.

Or - a low-tech solution, run the exe, then dbl-click a batchfile that  
starts up the default browser to the right addresss. So, a two step  
process.

Anybody handled this situation before?

Thanks  
Joerg

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 3:32pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/2 "2006-02-14T15:32:29Z")

</div>

I have used a similar program that popped up a window when executed  
that had a single button on it saying something to the effect of “The  
application is running and can be accessed at [http://127.0.0.1:3000](http://127.0.0.1:3000).  
Click here to open it in your default browser”

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 3:35pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/3 "2006-02-14T15:35:32Z")

</div>

On 2/14/06, Joerg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> One way would be to write a ruby script to run the exe … parse the  
> starts up the default browser to the right addresss. So, a two step  
> process.

You could check out the NSIS - [NSIS Wiki](http://nsis.sourceforge.net/Main_Page)

Create an installer and have it create shortcuts to  
[http://localhost:3000/](http://localhost:3000/). You might even be able to get it to find an  
unused port.

Tony

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/4 "2006-02-14T15:44:48Z")

</div>

And that same program first launched the exe, and then the popup? Did  
you only launch the popup once WEBrick was running? Did you parse the  
WEBrick output to figure out once it had started? Did you use Ruby for  
all this? Thanks for your help … 🙂

Ian H. wrote:

> I have used a similar program that popped up a window when executed  
> that had a single button on it saying something to the effect of “The  
> application is running and can be accessed at [http://127.0.0.1:3000](http://127.0.0.1:3000).  
> Click here to open it in your default browser”

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/5 "2006-02-14T18:16:01Z")

</div>

Ok got the installer working fine.  
It’s just that ‘one-click’ solution when starting up the app (running  
the exe, and launching the browser).

What libraries would I need to look at in Ruby to write this?

> Ian H. wrote:
> 
> > I have used a similar program that popped up a window when executed  
> > that had a single button on it saying something to the effect of “The  
> > application is running and can be accessed at [http://127.0.0.1:3000](http://127.0.0.1:3000).  
> > Click here to open it in your default browser”

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/6 "2006-02-14T18:35:40Z")

</div>

I didn’t do anything, I was just a user. I doubleclicked on the .exe,  
and the server started, and the dialog appeared. I could then either  
use the supplied button, or open my own browser to access it. Closing  
the dialog box killed the server. It was AOLServer in a starkit  
package.

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/7 "2006-02-14T19:17:53Z")

</div>

Ah right ok.

Maybe it was done in the ini.rb file that tar2rubyscript uses …

Ian H. wrote:

> I didn’t do anything, I was just a user. I doubleclicked on the .exe,  
> and the server started, and the dialog appeared. I could then either  
> use the supplied button, or open my own browser to access it. Closing  
> the dialog box killed the server. It was AOLServer in a starkit  
> package.

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 14, 2006, 6:32pm UTC](https://www.ruby-forum.com/t/launching-a-standalone-rails-app/53788/8 "2006-02-14T18:32:37Z")

</div>

> One way would be to write a ruby script to run the exe … parse the  
> results and once WEBrick has started off launch the default browser with  
> 127.0.0.1:3000.

Your exe is a ruby script compiled to exe isn’t it ? Could it fork the  
explorer.exe process with the good url ? (just an idea)

HTH

Thibaut
