简体   繁体   English

安装Rubber以正确启动实例创建

[英]Installing Rubber for proper Launch of instance creation

I am trying to launch an Amazon EC2 instance using Rubber. 我正在尝试使用Rubber启动Amazon EC2实例。

cap rubber:create_staging

rubber-ruby.yml reflects a version in use rubber-ruby.yml反映使用中的版本

ruby_build_version: 20141027
ruby_version: 1.9.3-p550

However upon cap rubber:create_staging capistrano immediately aborts with 但是在使用cap rubber:create_staging capistrano立即中止

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

with the capfile stating capfile说明

$:.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,该过程会早期失败)

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.rb文件是一个内衬

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

being called by the capfile 被capfile调用

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

Another oddity is that the final instruction of the Capfile calls 另一个奇怪的是,Capfile的最终指令调用

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) 并且该目录为空,这与说明一致: 可以将橡胶安装为rubygem(推荐)

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. 但是,这些差距(既没有提及橡胶宝石,也没有capistrano,没有针对宝石化偏好调用供应商/插件)告诉我,这里缺少一些步骤。 where has this gone wrong? 这出了什么问题?

It appears that gem identity matters : 宝石身份似乎很重要:

#  gem 'rubber'

would only install version 1.15.0, By specifying 只能安装1.15.0版,方法是指定

gem 'rubber', '3.1.0'

then cap rubber:config runs. 然后cap rubber:config运行。 create_staging will start running as well. create_staging也将开始运行。
note the version is an issue: the one originally posted was somehow requiring a separate capistrano entry and leading to a later failure. 请注意,该版本是一个问题:最初发布的版本以某种方式需要单独的capistrano条目,并导致以后的失败。 The list of versions is here 版本列表在这里

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

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