Capistrano upload?

How do I use the Capistrano upload function in a recipe? It seems simple
enough, but I can’t get it to work.

Here’s my recipe

desc "Copy the development database to the staging database"
task :copy_db_to_staging, :hosts =>'my_staging_server' do
  system "mysqldump -u root -pmypassword my_development_db >
~/db_backups/tg-3-dev-backup.sql"
  system "gzip ~/db_backups/tg-3-dev-backup.sql  "
  upload "~/db_backups/tg-3-dev-backup.sql.gz", "/my_dir_for_db_backups"
end

It all works until it gets to upload where it fails with

[]=': undefined method[]=’ for nil:NilClass (NoMethodError)

So what’s the technique for uploading a file using Capistrano?

Ta

John S.

John S. wrote:

How do I use the Capistrano upload function in a recipe? It seems simple
enough, but I can’t get it to work.

Here’s my recipe

desc "Copy the development database to the staging database"
task :copy_db_to_staging, :hosts =>'my_staging_server' do
  system "mysqldump -u root -pmypassword my_development_db >
~/db_backups/tg-3-dev-backup.sql"
  system "gzip ~/db_backups/tg-3-dev-backup.sql  "
  upload "~/db_backups/tg-3-dev-backup.sql.gz", "/my_dir_for_db_backups"
end

It all works until it gets to upload where it fails with

[]=': undefined method[]=’ for nil:NilClass (NoMethodError)

So what’s the technique for uploading a file using Capistrano?

Ta

John S.

try not to use “_” symbol in file names (and maybe paths)
also try to specify remote file name like this:

upload “~/db_backups/tg-3-dev-backup.sql.gz”,
“/my_dir_for_db_backups/tg-3-dev-backup.sql.gz”

if it doesn’t work, try to use :via => :scp

try not to use “_” symbol in file names (and maybe paths)
also try to specify remote file name like this:

upload “~/db_backups/tg-3-dev-backup.sql.gz”,
“/my_dir_for_db_backups/tg-3-dev-backup.sql.gz”

if it doesn’t work, try to use :via => :scp

:via => :scp gets it to work.

Thanks

John S.