3

I'm trying to get the backup RubyGem (https://github.com/meskyanichi/backup) working. When I try and trigger a backup I get:

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.

But checking for the dependency I get this:

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

And checking my ruby version gives me:

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

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

Looking at the source to backup, they are attempting to load the gem like this:

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

I don't use ruby and so I have no idea what is going on. Does somebody know what the problem is and how I could fix it? Or is there a better way to get a mongodb backup pushed to S3?

Thanks!

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 に答える