File.socket is not part of the Capistrano API (it's part of the File API
from the standard library) thus it runs on your machine, not on the server.
You should do:
if test("[ -S #{fetch(:shared_path)}/sockets/puma.sock ]")
info "It's a socket"
else
info "Not a socket"
end
Note you can't use `within` in this context, as if the command argument to
`test`, `execute` and friends contains a space character, it won't have
`within()`, `as()`, `with()` transformations applied.
Lee Hambley
--
http://lee.hambley.name/
+49 (0) 170 298 5667
On 14 November 2013 11:29, Andrei Varanovich <[email protected]> wrote:
> Hello,
>
> I have quite simple task (below it the relevant bits of it)
>
> within fetch(:shared_path) do
> puts "#{puma_socket} exists: #{File.socket?("sockets/puma.sock")}"
>
> which always gives me *false*, but the socket file exists and located in
> the /var/www/myapp/test/shared/sockets.
> File.exists? also gives false. In fact for ant file I am trying to check.
>
> I have a feeling it checks files on my local machine, not on the server.
> What is the right approach to check file on the server?
>
> Thanks,
> Andrei
>
> --
> --
> * You received this message because you are subscribed to the Google
> Groups "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to
> [email protected] For more options, visit this
> group at http://groups.google.com/group/capistrano?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en
---
You received this message because you are subscribed to the Google Groups
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.