2012-02-20 2 views
0

로컬 컴퓨터에서 서버로 helloworld 사이트를 배포하려고합니다. Ruby, Rails 및 Capistrano를 설치했습니다.Capistrano with PHP

에 대한 '

/usr/lib/ruby/1.8/capistrano/configuration/variables.rb:122:in method_missing': undefined local variable or method 차 오류 다음 명령 얻을 : "설치 캡 배포"조리법을 가진 후 나는이 입력 `부하 ./config/deploy.rb:19:in에서

(나가서 설명하자면 NameError) '

에서 load_from_file' from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in 부하 /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in' /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in load' from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in 각 ' load_from_file' from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in 에서 로드 '/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in에서/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in에서 '/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in load' from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in 각에서 '로드 load' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in load_recipes '/usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in each' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in load_recipes'/usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in에서 load_recipes ' execute!' from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in '/ usr/bin/cap에서 실행 : 4

다음은 내 deploy.rb 파일의 내용입니다.

set :application, "testapp" 
set :repository, "<url of git repo>" 
set :deploy_to, "var/www/html/testapp" 
set :document_root, "var/www/html/testapp/current" 

set :scm, :git 
set :scm_username, "MyUserName" 
set :scm_password, "MyPassword" 
set :scm_checkout, "clone" 
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` 

set :user, "<server's user name>" 
set :password, "<server's password>" 
set :use_sudo, false 
set :ssh_options, {:forward_agent => true} 

role :web, "<server's IP>"       # Your HTTP server, Apache/etc 
role :app, "<server's IP>"       # This may be the same as your `Web` server 
role :db, "<server's IP>", primary => true # This is where Rails migrations will run 

# If you are using Passenger mod_rails uncomment this: 
# if you're still using the script/reapear helper you will need 
# these http://github.com/rails/irs_process_scripts 

# namespace :deploy do 
# task :start {} 
# task :stop {} 
# task :restart, :roles => :app, :except => { :no_release => true } do 
#  run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
# end 
# end 
namespace :deploy do 
    task :update do 
     transaction do 
      update_code 
      symlink 
     end 
    end 

    task :finalize_update do 
     transaction do   
     end 
    end 

    task :symlink do 
     transaction do 
      run "ln -nfs #{current_release} #{deploy_to}/#{current_dir}" 
      run "ln -nfs #{deploy_to}/#{current_dir} #{document_root}" 
     end 
    end 

    task :migrate do 
    end 

    task :restart do 
    end 
end 

답변

1
role :db,  "<server's IP>", primary => true 

이어야한다

role :db,  "<server's IP>", :primary => true