为什么无法使用OAuth连接到Dropbox?

问题描述 投票:1回答:1

我想每晚将数据库备份存储在我的保管箱帐户中。为此,我使用了Backup + Dropbox gem。我的Ruby版本是1.8.7p358和Rails 2.3.8,我正在使用Mysql数据库。

这是我的控制台错误

[2012/10/26 11:25:28][error]ModelError: Backup for My Backup (my_backup) Failed!
[2012/10/26 11:25:28][error]   An Error occured which has caused this Backup to abort before completion.
[2012/10/26 11:25:28][error]   Please review the Log for this Backup to determine if steps need to be taken
[2012/10/26 11:25:28][error]   to clean up, based on the point at which the failure occured.
[2012/10/26 11:25:28][error]   Reason: OAuth::Unauthorized
[2012/10/26 11:25:28][error]   401 Unauthorized

这是我的代码

    Backup::Model.new(:my_backup, 'My Backup') do

      database MySQL do |db|
        db.name               = "app_development"
        db.username           = "user"
        db.password           = "pass"
        db.host               = "127.0.0.1"
      end

      store_with Dropbox do |db|
        db.api_key    = 'nvpsggrunft0'
        db.api_secret = '71dvvvdx48hy3'
        db.path       = '/backups'
        db.keep       = 80
        db.timeout    = 443
      end


      store_with FTP do |server|
        server.username = 'aadddn'
        server.password = 'tdsddsd'
        server.ip       = 'Ip Address'
        server.port     = 21
        server.path     = ''
        server.keep     = 30
        server.passive_mode = true
      end

      compress_with Gzip do |compression|
        compression.best = true
        compression.fast = false
      end

      notify_by Mail do |mail|
        mail.on_success           = true
        mail.on_failure           = true

        mail.from                 = '[email protected]'
        mail.to                   = '[email protected]'
        mail.address              = 'mail.abc.com'
        mail.port                 = 26
        mail.domain               = 'abc.com'
        mail.user_name            = 'abc'
        mail.password             = 'gvgfgxvxv'
        mail.authentication       = 'login'
        mail.enable_starttls_auto = false
      end  
end

我正在控制台中运行以下命令以进行备份

backup perform -t my_backup -c /home/xyz/my_workplace/abc/lib/Backup/config.rb 
ruby-on-rails ruby-on-rails-3 backup dropbox
1个回答
0
投票

Oauth授权URL将显示在previous version of Drop box gem上。我们可以简单地通过单击授权您的计算机的链接来解决问题。然后返回将成功保存在“放置”框中。

© www.soinside.com 2019 - 2024. All rights reserved.