3

我正在尝试让备份 RubyGem ( https://github.com/meskyanichi/backup ) 工作。当我尝试触发备份时,我得到:

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]

查看要备份的源,他们正尝试像这样加载 gem:

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?

谢谢!

4

1 回答 1

1

您在该备份目录中有 Gemfile 吗?我知道这在过去给我带来了问题。还可以尝试从备份目录之外运行备份并引用配置文件的位置。似乎有什么东西正在改变你的环境。您使用的是 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
于 2012-08-17T19:09:49.270 回答