tags:

views:

108

answers:

2

How do I open a browser window (Safari) with Ruby on a Mac and pass it a url?

+3  A: 

You can use:

`open #{url}`
Peter
i mean so it actually opens the browser window visibly, not just so I can read the response data.
viatropos
Did you try it? With the ``backticks``? It does exactly what you're after :)
Gareth
@viatropos, I tested this and it works. Make sure you incude include the `\`` characters.
macek
oops, tried it without the backticks. it works :). thanks!
viatropos
+1  A: 

Basically the same as Peter's answer, just more explicit.

system("open -a Safari #{url}")
Michael Kohl