In your case, then, where is the deploy.rb file, relative to the current directory when you run "cap setup"?
- Jamis On Sep 27, 2007, at 9:21 PM, lucas campbell wrote:
I don't believe I am passing any HOSTS environment variables... not sure what that is, I am following the capistrano tuturial in dreamhost. I am using cap 1.4.1.The error occurs when I cd into the root directory of my rails application. I run a cap setup and get the output below...... thanks for your help this is the first time I tried to setup svn and capistrano.[thetis]$ cap setup/usr/lib/ruby/gems/1.8/bin/cap:17:Warning: require_gem is obsolete. Use gem ins tead.* executing task setup* executing "umask 02 &&\n mkdir -p /u/apps/ /u/apps/releases / u/apps/ share d /u/apps/shared/system &&\n mkdir -p /u/apps/shared/ log &&\n mkdir -p / u/ apps/shared/pids" /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/ actor.rb:545:in `exe cute_on_servers': The setup task is only run for servers matching {:except=> {:no _release=>true}, :desc=>"Set up the expected application directory structure on all boxes"}, but no servers matched (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ actor.r b:207:in `run' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ recipes /standard.rb:39:in `load' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ actor.r b:159:in `instance_eval' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ actor.r b:159:in `setup' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 268:in `send' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 268:in `execute_recipes!' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 268:in `each' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 268:in `execute_recipes!' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 239:in `execute!' from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ capistrano/ cli.rb: 12:in `execute!'from /usr/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap:11 from /usr/lib/ruby/gems/1.8/bin/cap:18:in `load' from /usr/lib/ruby/gems/1.8/bin/cap:18 Jamis Buck <[EMAIL PROTECTED]> wrote: Alright, so you're not passing any HOSTS environment variables, then? Also, I assume you're still on cap 1.4.1? Also, what is the exact behavior that you're seeing? Are you seeing an error? - Jamis On Sep 27, 2007, at 8:26 PM, lucas campbell wrote: > cap setup > > Jamis Buck wrote: What is the command you are > trying to run? > > - Jamis > > On Sep 27, 2007, at 5:56 PM, bukaki wrote: > > > > > I am actually having the same problem as the original author. I do > > have a file named Capfile in my top level. Below is my deploy.rb > >> > # 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, "test" > > set :repository, "http://svn.sjsnetworking.com/test" > > > > # > >> ======================================================================> > ======= > > # 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/lukecampbell/domain" # 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 { "luke --password password" } > > > > # 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 <> 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 > > > > > > On Sep 4, 10:54 pm, chris wrote:> >> No I don't have a Capfile. I was under the impression that was for> >> 2.0 only, although I could very well be wrong. I am using 1.4.1. > >>> >> Although I ran the command again to find the previous error message> >> and this time it worked. Not sure why. I am just getting some > >> permission errors on the server for creating directories. > >> > >> Thanks for the help > >> > >> On Sep 4, 10:33 pm, "Jamis Buck" wrote: > >> > >> > >> > >>> ENV is a Hash instance, containing all defined environment > >>> variables. > >>> However, that's not really going to be the problem, since all it > >>> means> >>> is that you don't have one of the (optional) environment variables > >>> set. Rather, the error you are getting occurs when you don't have> >>> your > >>> roles configured correctly. Was what you pasted in your original > >>> email > >>> the entire contents of your config/deploy.rb? Do you have a file > >>> named > >>> Capfile in your top-level project directory? If so, what does it > >>> contain? > >> > >>> - Jamis > >> > >>> On 9/4/07, chris wrote: > >> > >>>> When running the cap setup command I am getting the following > >>>> error: > >> > >>>> executing "umask 02 &&\n mkdir -p /u/apps/ /u/apps/releases / > >>>> u/apps/> >>>> shared /u/apps/shared/system &&\n mkdir -p /u/apps/shared/ log &&> >>>> \n mkdir -p /u/apps/shared/pids" > >>>> /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ > capistrano/> >>>> actor.rb:545:in `execute_on_servers': The setup task is only run> >>>> for > >>>> servers matching {:except=>{:no_release=>true}, :desc=>"Set up > the > >>>> expected application directory structure on all boxes"}, but no > >>>> servers matched (RuntimeError) > >>> >>>> When looking at the Capistrano code it seems that it is unable to> >>>> obtain any hosts in the following code block. I What is the ENV > >>>> array? > >> > >>>> # /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/ > >>>> capistrano/ > >>>> actor.rb :108 > >>>> def environment_values(key, use_symbols = false) > >>>> if variable = ENV[key.to_s.upcase] ### This is where it > >>>> seems to > >>>> obtain nothing, then being false > >>>> values = variable.split(",") > >>>> use_symbols ? values.collect { |e| e.to_sym } : values > >>>> end > >>>> end > >> > >>>> Here is what I have in my deploy.rb file: > >>>> set :application, "softballsmart" > >>>> set :domain, "pointytack.com" > >>>> set :user, "chrisolsen" > >>>> set :svn, "/svn-repos/#{application}/trunk" > >>>> set :repository, "svn+ssh://[EMAIL PROTECTED]" > >>>> set :rails_env, "production" > >> > >>>> role :web, domain > >>>> role :app, domain > >>>> role :db, domain, :primary => true > >> > >>>> set :deploy_to, "/var/www/apps" > >>>> ssh_options[:keys] = %w(/Users/chrisolsen/.ssh/id_dsa) > >>>> ssh_options[:port] = 22 > >> > >>>> I am assuming that something is missing or set incorrectly. > Thanks > >>>> for the help- Hide quoted text - > >> > >> - Show quoted text - > > > > > > Be a better Globetrotter. Get better travel answers from someone > who knows. > Yahoo! Answers - Check it out.> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.--~--~---------~--~----~------------~-------~--~----~To unsubscribe from this group, send email to capistrano- [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/ group/capistrano-~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
