On May 27, 2008, at 11:03 PM, Rich Morin wrote:
>
> I'm having trouble getting a "solo" Capistrano app (as discussed
> in "Deploying Rails Applications") to work.  I'm hoping someone
> on this list can give me a hand.
>
> My impression is that the SSH login is failing, because of some
> authorization issue, but I've tried setting assorted variables
> with no success.  Help?
>
> -r
>
> P.S.  I'd also like to know is there's a way to get the return
>      code from a failing command, assuming I get that far...
>
> === === ===
>
> $ cat t1_s
> #!/usr/bin/env ruby
> #
> # t1_s - sub-command for use by t1.cap
>
>       puts 'Hi on STDOUT'
> STDERR.puts 'Hi on STDERR'
>
> === === ===
>
> $ cat t1.cap
> # t1.cap
>
>  set  :application, 'localhost'
>  set  :user,        'rdm'
>  role :arti,        application
>
>  desc 'Run a test command.'
>  task :test_cmd, :roles => :arti do
>    begin
>      cmd = 'Work/Cap/t1_s'
>      run cmd do |channel, stream, data|
>        case stream
>        when :err
>          puts "stderr from #{channel[:host]}: #{data}"
>        when :out
>          puts "stdout from #{channel[:host]}: #{data}"
>        end
>      end
>    rescue
>      puts 'Command failed: ' + $!
>    end
>  end
>
> === === ===
>
> $ cap -f ./t1.cap test_cmd
>  * executing `test_cmd'
>  * executing "Work/Cap/t1_s"
>    servers: ["localhost"]
> Command failed: connection failed for: localhost
>  (NoMethodError: private method `split' called for nil:NilClass)


It looks like you are just trying to deploy to localhost? Do you have  
an sshd server running on your local machine? Also this: cmd = 'Work/ 
Cap/t1_s'  looks a bit suspect to me. When you run a command via  
capistrano you have to be careful with absolute versus relative paths.  
You should add the fully qualified path to the front of that command

Cheers-
-Ezra



--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to