Hi folks.  I have the following task defined in my Capfile:

task :set_server_configs do
  mongrel_config(environment, deploy_to)
  apache_config(environment)
end


mongrel_config and apache_config are just methods in the Capfile.
mongrel_config works just fine.  apache_config doesn't.  The method
looks like this:


def apache_config(env)
  pit_conf_file = '/etc/ips/httpd-conf.d/programme_info_tool.conf'

  prefix = case env
             when 'development': 'dev.'
             when 'staging': 'staging.'
             else ''
           end

  config = "<Proxy balancer://pit_balance>\n" \
  "  BalancerMember http://localhost:8000\n"; \
  "  BalancerMember http://localhost:8001\n"; \
  "  BalancerMember http://localhost:8002\n"; \
  "</Proxy>\n" \
  "<VirtualHost *:80>\n" \
  "  ServerAdmin [EMAIL PROTECTED]" \
  "  ServerName #{prefix}pit.ips.radio.bbc.co.uk\n" \
  "  ProxyPass / balancer://pit_balance/\n" \
  "  ProxyPassReverse / balancer://pit_balance/\n" \
  "</VirtualHost>"

  f = File.open(pit_conf_file, 'w+')
  f.puts config
  f.close
end


And the output:

...
./Capfile:33:in `initialize': No such file or directory - /etc/ips/
httpd-conf.d/programme_info_tool.conf (Errno::ENOENT)
        from ./Capfile:33:in `open'
...

That line 33 is :  f = File.open(pit_conf_file, 'w+')

OK the file doesn't exists, but the 'w+' mode should create it, right?
And if I ssh into the deployment box as the user I'm *pretty sure*
Capistrano's running as (cause I've set :user, 'prog_info_tool') and
try to run that in IRB, it works just fine.


Any ideas what gives?
Many thanks.

Guy


--~--~---------~--~----~------------~-------~--~----~
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