2011-01-11 108 views
3

我正嘗試在Capistrano上部署本地工作的Rails 3應用程序到Dreamhost。 當我在'本地應用程序根目錄'中運行'cap deploy -v'時,我在'bundle install'窒息之前得到了很多。以下是錯誤消息的結束:與Capistrano部署Rails 3應用程序到Dreamhost時Bundle安裝失敗

**事務:開始** [abunchofletters.co.uk ::出] [email protected]'s密碼: 密碼:** [ abunchofletters.co.uk :: out] ** [abunchofletters.co.uk :: out] HEAD現在在62f9cdb初始部署到Dreamhost ** [out :: abunchofletters.co.uk] sh:bundle:command not找到 * [deploy:update_code]回滾 失敗:「sh -c'bundle install --gemfile /home/my_username/abunchofletters.co.uk/releases/20110111100145/Gemfile --path/home/my_username/abunchofletters .co.uk /共享/捆在abunchofletters.co.uk

--deployment --quiet --without開發測試'」然而,當我SSH到我的服務器,並檢查寶石列表,捆綁1.0.7被證明是安裝[也運行Ruby 1.8.7,Rails 3.0.3,RubyGems 1.3.6]。這是我第一次部署Rails應用程序和Capistrano應用程序的經驗,所以我接近無知,但我猜測某些路徑或變量設置不正確。

這裏是我的deploy.rb [從以下http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/因此可能是過時的創建]:

require "bundler/capistrano" # http://gembundler.com/deploying.html 

default_run_options[:pty] = true 

# be sure to change these 
set :user,  'my_username' 
set :domain,  'abunchofletters.co.uk' 
set :application, 'abunchofletters' 

# the rest should be good 
set :repository, "#{user}@#{domain}:git/#{application}.git" 
set :deploy_to, "/home/#{user}/#{domain}" 
set :deploy_via, :remote_cache 
set :scm, 'git' 
set :branch, 'master' 
set :git_shallow_clone, 1 
set :scm_verbose, true 
set :use_sudo, false 

server domain, :app, :web 
role :db, domain, :primary => true 

namespace :deploy do 
    task :restart do 
    run "touch #{current_path}/tmp/restart.txt" 
    end 
end 

任何想法如何進步?如果有任何更多的信息需要提醒我,我會提供。

回答

0

我對我提出的解決方案不太滿意,但它讓部署工作和捆綁器更新。

這裏是我的更新deploy.rb:

#require "bundler/capistrano" 

default_run_options[:pty] = true 

# be sure to change these 
set :user,  'futureproof' 
set :domain,  'abunchofletters.co.uk' 
set :application, 'abunchofletters' 

# the rest should be good 
set :repository, "#{user}@#{domain}:git/#{application}.git" 
set :deploy_to, "/home/#{user}/#{domain}" 
set :deploy_via, :remote_cache 
set :shared_path, "/home/#{user}/.gems" 
set :scm, 'git' 
set :branch, 'master' 
set :git_shallow_clone, 1 
set :scm_verbose, true 
set :use_sudo, false 

server domain, :app, :web 
role :db, domain, :primary => true 

namespace :deploy do 
    desc "expand the gems" 
    task :gems, :roles => :web, :except => { :no_release => true } do 
    run "cd #{current_path}; #{shared_path}/bin/bundle unlock" 
    run "cd #{current_path}; nice -19 #{shared_path}/bin/bundle install vendor/" # nice -19 is very important otherwise DH will kill the process! 
    run "cd #{current_path}; #{shared_path}/bin/bundle lock" 
    end 

    task :restart do 
    run "touch #{current_path}/tmp/restart.txt" 
    end 
end 

的:寶石任務在這裏看到:http://grigio.org/deploy_rails_3_passenger_apache_dreamhost,雖然束鎖定/解鎖現已棄用。可以簡單地用捆綁安裝/更新替換,但是不贊成將在今晚使用。

相關問題