2012-08-13 23 views
3

我試圖讓備份RubyGem(https://github.com/meskyanichi/backup)工作。當我嘗試和觸發備份我得到:試圖使用備份RubyGem,但它無法找到安裝的寶石

bill:~/Backup$ backup perform --trigger bidkat_backup 
[2012/08/13 16:58:37][error] Dependency::LoadError: Dependency missing 
[2012/08/13 16:58:37][error] Dependency required for: 
[2012/08/13 16:58:37][error] Amazon S3, Rackspace Cloud Files (S3, CloudFiles Storages) 
[2012/08/13 16:58:37][error] To install the gem, issue the following command: 
[2012/08/13 16:58:37][error] > gem install fog -v '~> 1.4.0' 
[2012/08/13 16:58:37][error] Please try again after installing the missing dependency. 

但是對於依賴我得到這個檢查:

bill:~/Backup$ gem query 

*** LOCAL GEMS *** 

builder (3.0.0) 
excon (0.14.3) 
fog (1.4.0) 
formatador (0.2.3) 
mime-types (1.19) 
multi_json (1.3.6) 
net-scp (1.0.4) 
net-ssh (2.5.2) 
nokogiri (1.5.5) 
ruby-hmac (0.4.0) 

bill:~/Backup$ which fog 
/usr/local/bin/fog 

而且檢查我的紅寶石版本給我:

bill:~/Backup$ which ruby 
/usr/bin/ruby 

bill:~/Backup$ ruby -v 
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] 

看着要備份的源代碼,他們正試圖像這樣加載寶石:

def self.all 
    { 
    'fog' => { 
     :require => 'fog', 
     :version => '~> 1.4.0', 
     :for  => 'Amazon S3, Rackspace Cloud Files (S3, CloudFiles Storages)' 
    }, 
    .... 
    } 

def self.load(name) 
    begin 
    gem(name, all[name][:version]) 
    require(all[name][:require]) 
    rescue LoadError 
    Logger.error Errors::Dependency::LoadError.new(<<-EOS) 
     Dependency missing 
     Dependency required for: 
     #{all[name][:for]} 
     To install the gem, issue the following command: 
     > gem install #{name} -v '#{all[name][:version]}' 
     Please try again after installing the missing dependency. 
    EOS 
    exit 1 
    end 
end 

我不使用紅寶石,所以我不知道發生了什麼。有人知道問題是什麼以及我如何修復它?或者有更好的方法將mongodb備份推送到S3?

謝謝!

回答

1

在備份目錄中是否有Gemfile?我知道這在過去對我造成了問題。另外嘗試從Backup目錄外部運行備份並引用配置文件的位置。看起來有些事情正在改變你的環境。你使用rvm還是rbenv或類似的東西?但雅,試試這個:

cd # to get back to user dir 
gem install backup 
gem install fog -v=1.4.0 
backup perform --trigger bidkat_backup --config-file path_to_config/config.rb 
+0

不知道爲什麼,但就是這樣。在備份目錄之外運行它有訣竅。謝謝! – Bill 2012-08-17 20:53:19