Thanks for your help.  I have been reading a lot of the forums, groups and 
blogs about capistrano and I keep seeing your name everywhere.  It seems you 
are probably the most informed person on this subject around.  :)  Because of 
this I would really appreciate if you could give me anymore ideas.  Below is my 
deploy.rb file.  I did add the task to restart the server a while back and the 
pids error still remains.  I am running out of ideas.  Thanks again.
   
  # This defines a deployment "recipe" that you can feed to capistrano
# (http://manuals.rubyonrails.com/read/book/17). It allows you to automate
# (among other things) the deployment of your application.
  # 
=============================================================================
# REQUIRED VARIABLES
# =============================================================================
# You must always specify the application and repository for every recipe. The
# repository must be the URL of the repository you want this recipe to
# correspond to. The deploy_to path must be the path on each machine that will
# form the root of the application path.
  set :user, "luke"
set :application, "jasper"
set :repository, http://svn.sjsnetworking.com/jasper_rose_checkout
  # 
=============================================================================
# ROLES
# =============================================================================
# You can define any number of roles, each of which contains any number of
# machines. Roles might include such things as :web, or :app, or :db, defining
# what the purpose of each machine is. You can also specify options that can
# be used to single out a specific subset of boxes in a particular role, like
# :primary => true.
  role :web, "sjsnetworking.com"
role :app, "sjsnetworking.com"
role :db,  "sjsnetworking.com", :primary => true
  # 
=============================================================================
# OPTIONAL VARIABLES
# =============================================================================
set :deploy_to, "/home/luke/sjsnetworking.com" # defaults to 
"/u/apps/#{application}"
set :use_sudo, false
set :checkout, "export"
# set :user, "flippy"            # defaults to the currently logged in user
# set :scm, :darcs               # defaults to :subversion
set :svn, "/usr/bin/svn"       # defaults to searching the PATH
set :svn_username, Proc.new { "username --password passoword" }
  # set :darcs, "/path/to/darcs"   # defaults to searching the PATH
# set :cvs, "/path/to/cvs"       # defaults to searching the PATH
# set :gateway, "gate.host.com"  # default to no gateway
   
  # 
=============================================================================
# SSH OPTIONS
# =============================================================================
# ssh_options[:keys] = %w(/path/to/my/key /path/to/another/key)
# ssh_options[:port] = 25
  # 
=============================================================================
# TASKS
# =============================================================================
# Define tasks that run on all (or only some) of the machines. You can specify
# a role (or set of roles) that each task should be executed on. You can also
# narrow the set of servers to a subset of a role by specifying options, which
# must match the options given for the servers to select (like :primary => true)
  desc <<DESC
An imaginary backup task. (Execute the 'show_tasks' task to display all
available tasks.)
DESC
task :backup, :roles => :db, :only => { :primary => true } do
  # the on_rollback handler is only executed if this task is executed within
  # a transaction (see below), AND it or a subsequent task fails.
  on_rollback { delete "/tmp/dump.sql" }
    run "mysqldump -u theuser -p thedatabase > /tmp/dump.sql" do |ch, stream, 
out|
    ch.send_data "thepassword\n" if out =~ /^Enter password:/
  end
end
  # Tasks may take advantage of several different helper methods to interact
# with the remote server(s). These are:
#
# * run(command, options={}, &block): execute the given command on all servers
#   associated with the current task, in parallel. The block, if given, should
#   accept three parameters: the communication channel, a symbol identifying the
#   type of stream (:err or :out), and the data. The block is invoked for all
#   output from the command, allowing you to inspect output and act
#   accordingly.
# * sudo(command, options={}, &block): same as run, but it executes the command
#   via sudo.
# * delete(path, options={}): deletes the given file or directory from all
#   associated servers. If :recursive => true is given in the options, the
#   delete uses "rm -rf" instead of "rm -f".
# * put(buffer, path, options={}): creates or overwrites a file at "path" on
#   all associated servers, populating it with the contents of "buffer". You
#   can specify :mode as an integer value, which will be used to set the mode
#   on the file.
# * render(template, options={}) or render(options={}): renders the given
#   template and returns a string. Alternatively, if the :template key is given,
#   it will be treated as the contents of the template to render. Any other keys
#   are treated as local variables, which are made available to the (ERb)
#   template.
   
  
desc "Demonstrates the various helper methods available to recipes."
task :helper_demo do
  # "setup" is a standard task which sets up the directory structure on the
  # remote servers. It is a good idea to run the "setup" task at least once
  # at the beginning of your app's lifetime (it is non-destructive).
  setup
    buffer = render("maintenance.rhtml", :deadline => ENV['UNTIL'])
  put buffer, "#{shared_path}/system/maintenance.html", :mode => 0644
  sudo "killall -USR1 dispatch.fcgi"
  run "#{release_path}/script/spin"
  delete "#{shared_path}/system/maintenance.html"
end
  # You can use "transaction" to indicate that if any of the tasks within it 
fail,
# all should be rolled back (for each task that specifies an on_rollback
# handler).
  desc "A task demonstrating the use of transactions."
task :long_deploy do
  transaction do
    update_code
    disable_web
    symlink
    migrate
  end
    restart
  enable_web
end
  desc "Restart the FCGI processes on the app server as a regular user."
task :restart, :roles => :app do
  run "#{current_path}/script/process/reaper --dispatcher=dispatch.fcgi"
end
desc "Restart the FCGI processes on the app server as a regular user."
  

Jamis Buck <[EMAIL PROTECTED]> wrote:
  That error will happen when (a) the fcgi's have not yet been started, 
or (b) when you are using server-managed fcgi's (e.g. letting apache 
start/stop them) rather than managing them yourself, independently of 
your web server. In the latter case, you'll need to redefine the 
restart task to restart your web server, something like:

task :restart, :roles => :web do
run "whatever you need to do to restart the webserver here"
end

- Jamis

On Sep 30, 2007, at 8:26 PM, lucas campbell wrote:

> I will try and post there. I actually noticed that when I do the 
> cap deploy command I am getting an error when running the restart 
> task. Does this also commonly happen when the HTTP_HOST 
> environment variable is not getting passed to the dispatcher?
>
>
> executing task restart
> * executing "/home/luke/sjsnetworking.com/current/script/process/ 
> reaper"
> servers: ["sjsnetworking.com"]
> [sjsnetworking.com] executing command
> ** [out :: sjsnetworking.com] Couldn't find any pid file in '/home/ 
> luke/sjsnetworking.com/current/tmp/pids' matching 'dispatch.[0-9] 
> *.pid'
> ** [out :: sjsnetworking.com] (also looked for processes matching 
> "/home/lukecampbell/sjsnetworking.com/current/public/dispatch.fcgi")
> command finished
>
>
> Jamis Buck wrote:
> In my experience, the "private method `split'" errors usually happen
> when the HTTP_HOST environment variable is not getting passed to the
> dispatcher. As to why that might be happening (and assuming that IS
> what is happening), I'm afraid I can't help you. :(
>
> This is not really a capistrano question, though. You might want to
> try posting it to the Rails-deploy mailing list (also on google).
>
> - Jamis
>
> On Sep 28, 2007, at 4:53 PM, bukaki wrote:
>
> >
> > I have set up my rails project on dreamhost using svn and 
> capistrano.
> > Everything has worked up to the point where I go to my url
> > www.mydomain.com.
> > Here I get an Internal server error 500 "The server encountered an
> > internal error or misconfiguration and was unable to complete your
> > request". In my dispatch.fastcgi.log the error below is displayed. I
> > am guessing I have set up something wrong in my dispatch.fcgi 
> file but
> > i don't know what.
> >
> >
> > [28/Sep/2007:10:46:41 :: 28651] Dispatcher failed to catch: private
> > method `split' called for nil:NilClass (NoMethodError)
> > /usr/lib/ruby/1.8/cgi.rb:897:in `parse'
> > /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> > cgi_ext/raw_post_data_fix.rb:45:in `initialize_query'
> > /usr/lib/ruby/1.8/cgi.rb:2274:in `initialize'
> > /usr/lib/ruby/1.8/fcgi.rb:594:in `new'
> > /usr/lib/ruby/1.8/fcgi.rb:594:in `each_cgi'
> > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in
> > `process_each_request!'
> > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:55:in
> > `process!'
> > /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in
> > `process!'
> > dispatch.fcgi:34
> > killed by this error
> >
> >
> > Don't let your dream ride pass you by. Make it a reality with 
> Yahoo! Autos.
> >



       
---------------------------------
Don't let your dream ride pass you by.    Make it a reality with Yahoo! Autos. 
--~--~---------~--~----~------------~-------~--~----~
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