Cap deploy problem

Can anybody tell me what’s happening here?

I can do this, with the expected results:

ssh -l somename dir2.com cd /var/www/dir1/dir2/current && ls -l

But then I do something similar via Capistrano I get an error at the
end…

  • executing task symlink
  • executing “ln -nfs /var/www/dir1/dir2/releases/20070302122224
    /var/www/dir1/dir2/current”
    servers: [“dir2.com”]
    [dir2.com] executing command
    command finished
  • executing task restart
  • executing task restart_mongrel_cluster
  • executing “mongrel_rails cluster::restart -C
    /var/www/dir1/dir2/current/config/mongrel_cluster.yml”
    servers: [“dir2.com”]
    [dir2.com] executing command
    ** [out :: dir2.com] Stopping 3 Mongrel servers…
    ** [out :: dir2.com] Starting 3 Mongrel servers…
    command finished
  • executing task after_restart
  • executing task restart_backgroundrb
  • executing task stop_backgroundrb
  • executing “cd /var/www/dir1/dir2/current && script/backgroundrb stop”
    servers: [“dir2.com”]
    [dir2.com] executing command
    command finished
  • executing task start_backgroundrb
  • executing “RAILS_ENV=production nohup cd /var/www/dir1/dir2/current
    && script/backgroundrb start”
    servers: [“dir2.com”]
    [dir2.com] executing command
    ** [out :: dir2.com] nohup:
    ** [out :: dir2.com] appending output to nohup.out' ** [out :: dir2.com] nohup: ** [out :: dir2.com] cannot run commandcd’
    ** [out :: dir2.com] : No such file or directory

I can give the same command from an ssh login shell and it works as
expected.

Clues for the clueless?

–Al Evans

This is the command that is failing:

RAILS_ENV=production nohup cd /var/www/dir1/dir2/current &&
script/backgroundrb start

I believe this will fail if you run it directly as well.

Try changing it to this:
export RAILS_ENV=production && cd /var/www/dir1/dir2/current && nohup
script/backgroundrb start

(You may also need to add an ‘&’ to the end.)

Shawn Balestracci

Vegan Buddy wrote:

Try changing it to this:
export RAILS_ENV=production && cd /var/www/dir1/dir2/current && nohup
script/backgroundrb start

Thanks! That worked great.

(You may also need to add an ‘&’ to the end.)

That isn’t necessary with the current version of backgroundrb.

Again, thank you for your help.

–Al Evans

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs