Docunext


Vlad versus Rails 3

January 23rd, 2011

It appears there is some sort of problem that I am having trying to use Vlad with Rails 3.

Could it be bundler?

rake aborted!
undefined method `remote_task' for #
/home/example/operations/dev/app.com/Rakefile:7
(See full trace by running task with --trace)

I'm also getting this error:

rake aborted!
Please specify the server domain via the :domain variable
(See full trace by running task with --trace)

And yes, I do have vlad-git installed....

I wonder what is wrong?

UPDATE:

I'm still having major issues with this, and it appears that the source of the problem is changes in Vlad's use of deploy.rb versus changes in Rake's use of lib/tasks/.

ARGH!

Anyway, I have made some progress, and am stumped when running vlad:setup:

undefined method `[]' for nil:NilClass

Yay! I think I figured it out. For some reason, I was using "remote_task" instead of "rake-remote_task". Grrr.

And for what its worth, my current config/deploy.rb looks similar to this:

set :myapp, "example.com"
set :deploy_to, "/var/www/dev/#{myapp}.com"
set :domain, "pro-103-gl.example.com"
set :repository, "git@github.com:user/example.com.git"

And my lib/tasks/vlad.rake file looks similar to this:

begin
  require 'vlad'
  Vlad.load :scm => :git
rescue
 # do nothing
end
namespace :vlad do
  remote_task :mkdaemon do
    run "mkdir -p /tmp/#{myapp}/log"
    run "echo '#!/bin/sh' > /tmp/#{myapp}/run"
    run "echo 'exec /var/www/dev/#{myapp}/current/demo.sh' >> /tmp/#{myapp}/run"
    run "echo '#!/bin/sh' > /tmp/#{myapp}/log/run"
    run "echo 'exec setuidgid daemon multilog t ./main' >> /tmp/#{myapp}/log/run"
    run "sudo chown -R root:root /tmp/#{myapp}"
    run "sudo chmod +x /tmp/#{myapp}/run"
    run "sudo chmod +x /tmp/#{myapp}/log/run"
    run "sudo mv /tmp/#{myapp} /service/"
  end
  remote_task :bundle do
    run "cd /var/www/dev/#{myapp}/current/ && bundle install &"
  end
  remote_task :restart do
    run "sudo svc -d /service/#{myapp}"
    run "sudo svc -u /service/#{myapp}"
  end
  remote_task :fix do
    run "mkdir -p /var/www/dev/#{myapp}/current/public/d/xhtml"
    run "chmod 0777 /var/www/dev/#{myapp}/current/public/d/xhtml"
  end
  remote_task :logtail do
    run "tail /tmp/webapps/#{myapp}.log -n 100"
  end
  task :deploy => [:update, :restart, :fix]
end
Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022