0

我正在使用“rubber”在“Amazon EC2”中部署我的项目。我正在关注 railscasts第 347 集 Rubber and Amazon EC2。但是当我尝试这个命令时

$cap rubber:create_staging

它要求

用于暂存实例 [生产] 的主机名:

现在当我输入它给出一个错误

/home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:137:in `expand_string': undefined method `reject' for nil:NilClass (NoMethodError)

我怎么解决这个问题?如果有人有任何想法,请与我分享。

代码细节:

[ec2-user@ip blog]$ cap rubber:create_staging
    triggering load callbacks
  * 2015-06-05 09:52:42 executing `rubber:init'
  * 2015-06-05 09:52:43 executing `rubber:create_staging'
Hostname to use for staging instance [production]:
/home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:137:in `expand_string': undefined method `reject' for nil:NilClass (NoMethodError)
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:137:in `eval'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:137:in `expand_string'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:149:in `expand'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:115:in `[]'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/environment.rb:193:in `method_missing'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/rubber-2.0.1/lib/rubber/recipes/rubber/utils.rb:22:in `block (2 levels) in load'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `each'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:34:in `execute!'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/bin/cap:23:in `load'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/bin/cap:23:in `<main>'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
    from /home/ec2-user/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
4

0 回答 0