Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please reconsidere my pull request: Fix syntax "each" for ruby1.9 => each_line and add listen_port on rewrite_www_to_non_www #114

Merged
merged 15 commits into from
Aug 22, 2013

Conversation

helldorado
Copy link
Contributor

String#each is no longer available in Ruby 1.9, useString#each_line` instead.

Debug Examples:
Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template nginx/vhost/vhost_footer.erb:
Filepath: /etc/puppet/modules/nginx/templates/vhost/vhost_footer.erb
Line: 1
Detail: undefined method `each' for "global/security.conf":String

add listen_port on rewrite_www_to_non_www
Adding the port in case it is not by default.

@jfryman
Copy link
Contributor

jfryman commented Aug 22, 2013

Cool. Looks good. Thanks. 👍

jfryman pushed a commit that referenced this pull request Aug 22, 2013
Please reconsidere my pull request: Fix syntax "each" for ruby1.9 => each_line and add listen_port on rewrite_www_to_non_www
@jfryman jfryman merged commit f98feea into voxpupuli:master Aug 22, 2013
@abraham1901
Copy link
Contributor

each_line not work for me!

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template nginx/vhost/vhost_location_directory.erb:
Filepath: /usr/lib/ruby/vendor_ruby/rgen/array_extensions.rb
Line: 25
Detail: undefined method `each_line' for ["index.php", "index.html", "index.htm"]:Array
at /etc/puppet/modules/nginx/manifests/resource/location.pp:148 on node xxx
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

puppet 3.2.4-1puppetlabs1
ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

@abraham1901
Copy link
Contributor

String#each is no longer available in Ruby 1.9, useString#each_line` instead.

Only String!
Why you use each_line for array? Class Array don't have method each_line on ruby 1.8.x, 1.9.x, 2.0.x

proxy_set_header - array
try_files - array
index_files -array
include_files - array
vhost_cfg_append - array

@helldorado
Copy link
Contributor Author

Indeed are arrays.

I'll roolback on my side, the EACH should be able to operate on the 1.8 and 1.9

@abraham1901
Copy link
Contributor

I'm added bug fix PR #121

cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Oct 23, 2017
Please reconsidere my pull request: Fix syntax "each" for ruby1.9 => each_line and add listen_port on rewrite_www_to_non_www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants