Thanks All. Finally I've found an easier way to fix this problem. I SSH 
to the box and do WGET to get the remote file. I am not sure this is the 
best way but it seems working. I guess I need to learn some 
Ruby/Capistrano in meanwhile.

Homer





David Masover wrote:
> On Thursday 12 November 2009 09:30:14 am Homer Najafi wrote:
>> Is there any way in Ruby to say Open the file remotely (e.g.
>> °»Server2:/home/test/test.txt°…) (assuming there is no Server of any kind
>> installed on Server2).
> 
> Short answer: No. That's really not a Ruby question, either -- would you
> expect that to work in any language?
> 
>> Strange is if I have a command like run "bash --login -c 'touch
>> test.txt'", it will create test.txt in the right defined Host (Server2).
>> But °∆open°« somehow is failing.
> 
> Ah, now this is a Capistrano question. FYI, there is a Capistrano group.
> 
> First, how are you running this command? Ruby has two main ways of 
> running
> commands: system and backticks. It seems you're doing neither of these, 
> but
> rather, "run", which is a Capistrano command.
> 
> Run sends that command over to the remote server, over the ssh 
> connection, to
> run there.
> 
> Ruby code in Cap, however, runs locally. Try running the same command 
> with
> "system" and see what happens.
> 
> If all you're wanting to do is programmatically generate a file as you 
> upload
> it, I seem to remember some Capistrano recipes for that. It's been 
> awhile,
> though, and I'm feeling lazy, so ask the Capistrano group.

-- 
Posted via http://www.ruby-forum.com/.