Forum: Ruby on Rails Launching a standalone Rails app

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joerg D. (Guest)
on 2006-02-14 16:24
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
Ian H. (Guest)
on 2006-02-14 16:32
(Received via mailing list)
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.
Click here to open it in your default browser"
Tony C. (Guest)
on 2006-02-14 16:35
(Received via mailing list)
On 2/14/06, Joerg D. <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 - http://nsis.sourceforge.net/Main_Page

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

Tony
Joerg D. (Guest)
on 2006-02-14 16:44
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.
> Click here to open it in your default browser"
Joerg D. (Guest)
on 2006-02-14 19:16
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.
>> Click here to open it in your default browser"
Thibaut Barrère (Guest)
on 2006-02-14 19:32
(Received via mailing list)
>
> 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
Ian H. (Guest)
on 2006-02-14 19:35
(Received via mailing list)
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.
Joerg D. (Guest)
on 2006-02-14 20:17
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.
This topic is locked and can not be replied to.