简体   繁体   English

使用AWS-SDK短跑EC2小部件引发Backport错误

[英]Dashing EC2 Widget Throwing Backport error with AWS-SDK

I have a Dashing dashboard and would like to use the Dashing EC2 Cloudfront widget within it. 我有一个Dashing仪表板,想在其中使用Dashing EC2 Cloudfront小部件。 The gist for the widget is here https://gist.github.com/jwalton/6614087 and Dashing is here http://shopify.github.io/dashing/#widgets 小部件的要点在这里https://gist.github.com/jwalton/6614087,而Dashing在这里http://shopify.github.io/dashing/#widgets

I have RVM manage my ruby and gems and have the aws-sdk gem as well as all other gems installed. 我让RVM管理我的红宝石和宝石,并安装了aws-sdk宝石以及所有其他宝石。

The #lib/dashing_ec2.rb file is causing the error with the require aws-sdk #lib / dashing_ec2.rb文件引起了require aws-sdk错误

I am unsure what to do from here as I researched Backports and found nothing relatable. 当我研究Backports并没有发现任何相关内容时,我不确定从这里开始该怎么做。

This is the error from thin.log of Dashing: 这是Dashing的thin.log中的错误:

/home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require': cannot load such file -- aws-sdk (LoadError)
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
    from /opt/opsdash/lib/dashing_ec2.rb:3:in `<top (required)>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/dashing-1.3.2/lib/dashing.rb:162:in `block in <top (required)>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/dashing-1.3.2/lib/dashing.rb:162:in `each'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/dashing-1.3.2/lib/dashing.rb:162:in `<top (required)>'
    from config.ru:1:in `require'
    from config.ru:1:in `block in <main>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1:in `<main>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/rack/adapter/loader.rb:33:in `eval'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/rack/adapter/loader.rb:33:in `load'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/thin/controllers/controller.rb:72:in `start'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/bin/thin:23:in `load'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/bin/thin:23:in `<main>'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/bin/ruby_executable_hooks:15:in `eval'
    from /home/ubuntu/.rvm/gems/ruby-2.1.2@dashing/bin/ruby_executable_hooks:15:in `<main>'

It was in my gemset, but not in my Gemfile. 它在我的宝石集中,但不在我的Gemfile中。

Adding to Gemfile resolved the issue. 添加到Gemfile解决了该问题。

add to Gemfile(and bundle install ) : gem 'aws-sdk' 添加到Gemfile中(并捆绑安装):gem'aws-sdk'

you need to change the ' lib_dashing_ec2.rb '(from the gist) under " lib/dashing_ec2.rb " and change the require in the ec2.rb file: require ' ./lib/dashing_ec2' 您需要更改“ lib / dashing_ec2.rb ”下的“ lib_dashing_ec2.rb ”(从要点开始)并在ec2.rb文件中更改require:require' ./ lib/ dashing_ec2'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM