简体   繁体   中英

Installing Rubber for proper Launch of instance creation

I am trying to launch an Amazon EC2 instance using Rubber.

cap rubber:create_staging

rubber-ruby.yml reflects a version in use

ruby_build_version: 20141027
ruby_version: 1.9.3-p550

However upon cap rubber:create_staging capistrano immediately aborts with

LoadError: cannot load such file -- rubber
/Users/you/r/rubbertest/Capfile:14:in `require'

with the capfile stating

$:.unshift "#{root}/vendor/plugins/rubber/lib/"  # line 13
require 'rubber'                                 # line 14

So I assumed a rubber gem would be necessary. The gem file edited (without capistrano the process failed early)

gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-rvm'
gem 'rubber'

And the process went one step further to another failure:

NoMethodError: undefined method `instance' for Capistrano::Configuration:Class
/Users/you/.rvm/gems/ruby-1.9.3-p551/gems/rubber-1.15.0/lib/rubber/capistrano.rb:1:in `<top (required)>'
/Users/you/r/rubbertest/Capfile:17:in `require'

the capistrano.rb file is a one liner

Capistrano::Configuration.instance.load(File.join(File.dirname(__FILE__), 'recipes', 'rubber.rb'))

being called by the capfile

Rubber::initialize(root, env)
require 'rubber/capistrano'   # line 17

Another oddity is that the final instruction of the Capfile calls

Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

and that directory is empty which is consistent with the instructions : Rubber can be installed as a rubygem (recommended)

I have run this twice with identical behaviour.

However these gaps (no reference to rubber gem, nor capistrano, calling vendor/plugins against gemmification preference) tell me that some step is missing here. where has this gone wrong?

It appears that gem identity matters :

#  gem 'rubber'

would only install version 1.15.0, By specifying

gem 'rubber', '3.1.0'

then cap rubber:config runs. create_staging will start running as well.
note the version is an issue: the one originally posted was somehow requiring a separate capistrano entry and leading to a later failure. The list of versions is here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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