2012-09-20 49 views
5

這是我第一次使用橡膠或部署到Amazon EC2。我正在關注這個Railscast。我已經搜遍了,沒有人似乎有這個問題。這裏是我的控制檯日誌,當我運行cap rubber:create_staging嘗試部署使用橡膠的jRoR應用並獲取NoMethodError:未定義的方法`authorize_port_range'爲零:NilClass

[email protected]:~/develops/grouper$ cap rubber:create_staging 
    triggering load callbacks 
    * executing `rubber:init' 
    * executing `rubber:create_staging' 
Hostname to use for staging instance [production]: 
Roles to use for staging instance [apache,app,collectd,common,db:primary=true,elasticsearch,examples,graphite_server,graphite_web,graylog_elasticsearch,graylog_mongodb,graylog_server,graylog_web,haproxy,mongodb,monit,passenger,postgresql,postgresql_master,web,web_tools]: 
    * executing `rubber:create' 
Excon nonblock is not supported by your OpenSSL::SSL::SSLSocket 
Excon nonblock is not supported by your OpenSSL::SSL::SSLSocket 
    * Creating new security group: grouper_production_default 
    * Creating new rule: {"source_group_name"=>"grouper_production_default", "source_group_account"=>"<account id redacted>"} 
[DEPRECATION] authorize_group_and_owner is deprecated, use authorize_port_range with :group option instead 
    * Creating new rule: {"protocol"=>"tcp", "from_port"=>"22", "to_port"=>"22", "source_ips"=>["0.0.0.0/0"]} 
NoMethodError: undefined method `authorize_port_range' for nil:NilClass 
    add_security_group_rule at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/cloud/fog.rb:182 
        send at org/jruby/RubyKernel.java:2088 
      method_missing at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/thread_safe_proxy.rb:13 
    sync_security_groups at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/security_groups.rb:221 
        each at org/jruby/RubyArray.java:1615 
    sync_security_groups at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/security_groups.rb:220 
        each at org/jruby/RubyArray.java:1615 
    sync_security_groups at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/security_groups.rb:214 
        each at org/jruby/RubyArray.java:1615 
    sync_security_groups at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/security_groups.rb:208 
    setup_security_groups at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/security_groups.rb:51 
      create_instance at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/instances.rb:255 
      create_instance at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/instances.rb:254 
     create_instances at /home/user529789/.rvm/gems/[email protected]/gems/rubber-2.1.0/lib/rubber/recipes/rubber/instances.rb:217 
        call at org/jruby/RubyProc.java:270 
        call at org/jruby/RubyProc.java:224 

回答

0

我的猜測是,它的尋找範圍,並在堆棧跟蹤你給的範圍是從一個端口到同一個端口和紅寶石,特別是JRuby的可能錯誤地構造端口範圍。

,你可以嘗試在IRB

(22..22).to_a將在JRuby的版本上運行,看看你會得到什麼。在mri中,你會得到[22],但在jruby中可能存在執行錯誤。

發生故障時正在執行的代碼,我認爲是在這裏: https://github.com/rubber/rubber/blob/v2.1.0/lib/rubber/cloud/fog.rb#L182

編輯

找了幾分鐘後,其明確表示,橡膠傳遞參數給霧寶石和我m很確定,即使範圍可能解決,霧的使用方式也需要一個範圍。你可以嘗試一些從21到23或22到23的範圍,看看是否能讓你超過錯誤。另外,請注意,您使用的橡膠版本遠遠落後於主版本。我沒有任何參考指出這是否合意,但你應該意識到這一點。祝你好運。

0

爲我工作一個解決辦法是去 rubber.yml

,並設置所有相關的安全組從「真」「假」 不知道的這所有效果的選項但似乎打通。

相關問題