2013-11-22 47 views
1

我一直試圖配置我的部署與卡皮斯特拉諾幾個星期了,它仍然無法正常工作。每次我部署到我的服務器我得到一個錯誤說寶石丟失,如:仍然沒有找到與卡皮斯特拉諾的寶石

DEBUG [a0e618f0] /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize' 
DEBUG [a0e618f0] : 
DEBUG [a0e618f0] Could not find ansi-1.4.3 in any of the sources 
DEBUG [a0e618f0]  (
DEBUG [a0e618f0] Bundler::GemNotFound 
DEBUG [a0e618f0] ) 

我知道如何解決這個問題,只需安裝「ANSI」的寶石,但這裏有一個更大的問題:爲什麼bundler不能與capistrano正常工作?

當我看到在輸出更高的I看到:

INFO [1ee9a88e] Running ~/.rvm/bin/rvm ruby-2.0.0-p247 do bundle --gemfile /var/www/html/SparkMyInterest/releases/20131122204608/Gemfile --path /var/www/html/SparkMyInterest/shared/bundle --deployment --quiet --binstubs /var/www/html/SparkMyInterest/shared/bin --without development test on 54.200.196.1 
DEBUG [1ee9a88e] Command: cd /var/www/html/SparkMyInterest/releases/20131122204608 && (RAILS_ENV=production ~/.rvm/bin/rvm ruby-2.0.0-p247 do bundle --gemfile /var/www/html/SparkMyInterest/releases/20131122204608/Gemfile --path /var/www/html/SparkMyInterest/shared/bundle --deployment --quiet --binstubs /var/www/html/SparkMyInterest/shared/bin --without development test) 
INFO [1ee9a88e] Finished in 20.132 seconds with exit status 0 (successful). 
DEBUG [7d1a9e40] Running if test ! -d /var/www/html/SparkMyInterest/releases/20131122204608; then echo "Directory does not exist '/var/www/html/SparkMyInterest/releases/20131122204608'" 1>&2; false; fi on 54.200.196.1 
DEBUG [7d1a9e40] Command: if test ! -d /var/www/html/SparkMyInterest/releases/20131122204608; then echo "Directory does not exist '/var/www/html/SparkMyInterest/releases/20131122204608'" 1>&2; false; fi 
DEBUG [7d1a9e40] Finished in 1.291 seconds with exit status 0 (successful). 
INFO [a0e618f0] Running ~/.rvm/bin/rvm ruby-2.0.0-p247 do rake assets:precompile on 54.200.196.1 
DEBUG [a0e618f0] Command: cd /var/www/html/SparkMyInterest/releases/20131122204608 && (RAILS_ENV=production ~/.rvm/bin/rvm ruby-2.0.0-p247 do rake assets:precompile) 
DEBUG [a0e618f0] /home/ec2-user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize' 
DEBUG [a0e618f0] : 
DEBUG [a0e618f0] Could not find ansi-1.4.3 in any of the sources 
DEBUG [a0e618f0]  (
DEBUG [a0e618f0] Bundler::GemNotFound 
DEBUG [a0e618f0] ) 

顯然,這看起來捆綁已運行(和成功的!)。是什麼賦予了?

這裏是我的帽子文件:

# Load DSL and Setup Up Stages 
require 'capistrano/setup' 

# Includes default deployment tasks 
require 'capistrano/deploy' 

require 'capistrano/rvm' 
require 'capistrano/bundler' 
require 'capistrano/rails/assets' 
require 'capistrano/rails/migrations' 

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. 
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } 

而在我production.rb在頂部(我與生產部署),我有:

set :stage, :production 
set :rails_env, "production" 

任何想法,爲什麼捆綁器不加工?和/或爲什麼它永遠不會安裝所有必需的寶石?

謝謝億

+0

向我們展示你的'Gemfile' –

回答

0

我已經提供了一些額外的信息通過與參與(需RVM/Capistrano的)RVM類似問題的努力capitrano

set :bundle_cmd, '/path/to/project/rvm/bundle' 
set :default_shell, :bash 
set :rvm_type, :system 
set :rvm_ruby_string, release_path 

此代碼是我的舞臺,一個特定部署(例如,deploy/production.rb)。我必須解決的問題是,捆綁包已安裝,但錯誤的地方;也可能是你在這裏面臨的。

FWIW,rvm/capsitrano也讓我指定在部署腳本中運行某些命令時使用的shell。例如,我正在使用每當gem更新我的crontab並需要「rvm_shell」(我的具體ruby與gemset)來使capistrano發生這種情況。該生產線是這樣的:

run "cd #{release_path} && bundle exec whenever -w -s environment=production", shell: fetch(:rvm_shell) 
+0

了DEBUG [db260c6b]命令:(RAILS_ENV =生產的/ usr /本地/ RVM /斌/ RVM電流) DEBUG [db260c6b] \t慶典:/usr/local/rvm/bin/rvm:沒有這樣的文件或目錄 cap aborted! – Rob