H
Homer Najafi
I know that this question looks like a Webistrano question but since I
don’t know much about Ruby, I thought it might be a simple Ruby question
too.
We have installed Webistrano and Capistrano install on some server
(let’s say Server1). I have created a Webistrano project and inside it I
have defined my Host to be ‘Server2’. I have this Ruby code inside my
project:
require 'open-uri'
writeout = open("/home/test/test.txt", "wb")
writeout.write(“TESTâ€)
writeout.close
The problem is Webistrano is giving me an error saying that
/home/test/test.txt does not exist. I believe what It’s trying to do is
to create test.txt in Server1 (Capistrano Server) instead of my defined
Host.
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).
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.
Thanks in Advance,
Homer
don’t know much about Ruby, I thought it might be a simple Ruby question
too.
We have installed Webistrano and Capistrano install on some server
(let’s say Server1). I have created a Webistrano project and inside it I
have defined my Host to be ‘Server2’. I have this Ruby code inside my
project:
require 'open-uri'
writeout = open("/home/test/test.txt", "wb")
writeout.write(“TESTâ€)
writeout.close
The problem is Webistrano is giving me an error saying that
/home/test/test.txt does not exist. I believe what It’s trying to do is
to create test.txt in Server1 (Capistrano Server) instead of my defined
Host.
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).
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.
Thanks in Advance,
Homer