OpsWorks Ruby returning nil for valid regex test -
in opsworks, i'm trying test number suffix on hostname of given node, , extract number if isn't 1. if number isn't 1, have regex match number: /([\d]+)$/ which run against node naming scheme follows pattern: node1 node2 node3 node(n...) i've verified works using rubular: http://rubular.com/r/ei0kqjaxqn however, when run against instance opsworks, match returns nil, no matter number hostname has @ end. opsworks agent version latest @ time of writing (4023), using chef 12.13.37. this code in cookbook trying use matched number: short_app_name.to_s + node['hostname'][/([\d]+)$/, 1].to_s + '.' + app['domains'].first the run fails type error no implicit conversion of nil string . however, regex searches against property work earlier in recipe, when checking node's number suffix. there different method should using extract node's suffix? edit: app['domains'].first populated. line still fails same type erro...