0

I have been following this railscast tutorial and I am pretty sure I followed all the steps correctly but when I go to run cap rubber:create_staging I get the following error.

Not sure where to even start to debug this.

 The key pair 'gsg-keypair' does not exist (Fog::Compute::AWS::NotFound)
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:332:in `response'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/excon-0.20.1/lib/excon/connection.rb:226:in `request'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/core/connection.rb:21:in `request'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/compute.rb:384:in `_request'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/compute.rb:379:in `request'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/requests/compute/run_instances.rb:119:in `run_instances'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/aws/models/compute/server.rb:173:in `save'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/fog-1.10.0/lib/fog/core/collection.rb:52:in `create'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/cloud/fog.rb:27:in `create_instance'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/thread_safe_proxy.rb:13:in `method_missing'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/instances.rb:310:in `create_instance'
    from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rubber-2.2.4/lib/rubber/recipes/rubber/instances.rb:230:in `block (2 levels) in create_instances' 
Cool Guy Yo
  • 5,910
  • 14
  • 59
  • 89

2 Answers2

0

its saying that it can't find your 'gsg-keypair', go back to the part of the video where it teaches you how to save the gsg-keypair from amazon and where to save by mkdir in your root directory.

Jngai1297
  • 2,415
  • 5
  • 29
  • 63
0

You need to create your virtual instance. Then Download key-pair (eg xyz.pem) file and follow these commands.

$ mkdir ~/.ec2
$ mv ~/Downloads/xyz.pem ~/.ec2/xyz
$ chmod 600 ~/.ec2/xyz

To make public key version --

$ ssh-keygen -y -f ~/.ec2/xyz > ~/.ec2/xyz.pub

Then go to config/rubber/rubber.yml and change your key_name to this

key_name: xyz
key_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/*' + cloud_providers.aws.key_name].first}"

Hope this may solve your problem.

Free-Minded
  • 5,322
  • 6
  • 50
  • 93