Forum: Ruby on Rails capistrano can't find svn

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.
0bcc972918891ef358b0b3dfb4e7f18b?d=identicon&s=25 Hammed Malik (Guest)
on 2006-05-17 00:53
(Received via mailing list)
I'm trying to get capistrano to deploy to an osx machine - rake
remote:cold_deploy but it fails on the svn co line with

"bash: line 2: svn: command not found"

I've set the proper path to svn (/usr/local/bin) in both .bash_profile
and .bash_login but capistrano seems to be ignoring these.

How does capistrano know where to look for svn?

Thanks
0bcc972918891ef358b0b3dfb4e7f18b?d=identicon&s=25 Hammed Malik (Guest)
on 2006-05-17 01:08
(Received via mailing list)
Oops! Didn't notice:

# set :svn, "/path/to/svn"       # defaults to searching the PATH

in deploy.rb. Still it doesn't seem to search the PATH.
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-05-17 21:53
(Received via mailing list)
Hammed,

You need to set the :svn variable. The PATH it searches is the path
that is baked into sshd, which is usually only /bin and /usr/bin.

- Jamis
807e34b31d5463a9ac05d41458a9e537?d=identicon&s=25 Al Evans (al-evans)
on 2006-05-17 23:05
Jamis Buck wrote:

> You need to set the :svn variable. The PATH it searches is the path
> that is baked into sshd, which is usually only /bin and /usr/bin.

You can generally modify the search path for remote ssh commands by
creating a .bashrc file in your home directory. For example, mine says:

export PATH=$HOME/local/bin:$PATH

on a machine where I have my own copies of a lot of binaries.

--Al Evans
0bcc972918891ef358b0b3dfb4e7f18b?d=identicon&s=25 Hammed Malik (Guest)
on 2006-05-18 04:55
(Received via mailing list)
Hi Al,

> You can generally modify the search path for remote ssh commands by
> creating a .bashrc file in your home directory. For example, mine says:
>
> export PATH=$HOME/local/bin:$PATH

Are you sure about this? I tried it and it didn't work. I have

export PATH=/usr/local/bin:$PATH

in my .bashrc which is in the home directory and is executable.
E28c35323f624b8b9ed8712e25105454?d=identicon&s=25 Ray Baxter (Guest)
on 2006-05-18 06:42
(Received via mailing list)
Hammed Malik wrote:

>> You can generally modify the search path for remote ssh commands by
>> creating a .bashrc file in your home directory. For example, mine says:
>>
>> export PATH=$HOME/local/bin:$PATH
>
> Are you sure about this? I tried it and it didn't work. I have
>
> export PATH=/usr/local/bin:$PATH
>
> in my .bashrc which is in the home directory and is executable.

Works for me as well. Your .bashrc (on the remote host, right?) doesn't
need to be executable. You also have to have .bashrc as your login
shell. If your login shell is tcsh you need a .cshrc file.

--

Ray
0bcc972918891ef358b0b3dfb4e7f18b?d=identicon&s=25 Hammed Malik (Guest)
on 2006-05-18 07:31
(Received via mailing list)
Ray,

The .bashrc file is on the remote server which is OSX.

According to  http://www.osxfaq.com/tips/unix-tricks/week105/monday.ws
, non-login shells don't run any scripts on startup:

Non-interactive shells. When you run a shell script, a new shell is
launched to execute the script. The new shell is a non-interactive
(non-login) shell. It does not source any scripts on startup.
E28c35323f624b8b9ed8712e25105454?d=identicon&s=25 Ray Baxter (Guest)
on 2006-05-18 07:58
(Received via mailing list)
Hammed Malik wrote:

> The .bashrc file is on the remote server which is OSX.
>
> According to  http://www.osxfaq.com/tips/unix-tricks/week105/monday.ws
> , non-login shells don't run any scripts on startup:
>
> Non-interactive shells. When you run a shell script, a new shell is
> launched to execute the script. The new shell is a non-interactive
> (non-login) shell. It does not source any scripts on startup.


The ssh session is a login shell. A Non-interactive shell is when you
execute a shell script. The ssh session logins you in.

I added this line to my .bashrc on my OS X server,

echo "Hi there"

Then I sshed to that machine from another server

stork$ ssh ray@auk date
Hi there
Wed May 17 22:46:55 PDT 2006
stork$

You can see that the contents of the .bashrc appear.

Your problem may be the presence of a .bash_profile

>  When  bash is invoked as an interactive login shell, or as a non-inter-
>  active shell with the --login option, it first reads and executes  com-
>  mands  from  the file /etc/profile, if that file exists.  After reading
>  that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
>  in  that order, and reads and executes commands from the first one that
>  exists and is readable.  The --noprofile option may be  used  when  the
>  shell is started to inhibit this behavior.

--

Ray
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-05-20 08:58
(Received via mailing list)
Note, however, that Capistrano does not use a login shell, thus
the .bashrc is not executed when Capistrano sessions are created.

There are supposedly ways to work around this--for instance, if your
sshd is configured to support it, you can have ~/.ssh/environment
contain the variables you want set by all new sessions (login shell
or not). However, this appears to be disabled by default for most
installations.

- Jamis
This topic is locked and can not be replied to.