Rake db:schema:load from capistrano

Hi,

I’m not sure why this isn’t working form me. In my deploy script
I have the following task:

desc “cold deploy”
task :cold do
update
mongrel.cluster.configure
run “cd #{release_path}”
sudo “rake db:schema:load”
start
mongrel.cluster.status
end

Unfortunately I get this nasty error:

  • executing “rake db:schema:load”
    servers: [“alvaket.be”]
    [alvaket.be] executing command
    ** [out :: alvaket.be] rake aborted!
    ** [out :: alvaket.be]
    ** [out :: alvaket.be] No Rakefile found (looking for: rakefile,
    Rakefile, rakefile.rb, Rakefile.rb)

BUT, it works when I deploy without db:schema:load and then run
db:schema:load manually on the server … Strange because Rakefile is
uploaded during update

as you do the cd in one call and the rake in a second call, the
working dir for the second call is not correct.

Try:

run “cd #{release_path} && sudo rake db:schema:load”

That should do what you expected.

On 21 Mai, 11:23, Maarten P. [email protected]

Matthias wrote:

as you do the cd in one call and the rake in a second call, the
working dir for the second call is not correct.

Try:

run “cd #{release_path} && sudo rake db:schema:load”

That should do what you expected.

On 21 Mai, 11:23, Maarten P. [email protected]

Thank you very much. It seems to work nicely!