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

Fix syntax error in ERB template for fastcgi location. #1168

Merged
merged 1 commit into from
Jan 10, 2018
Merged

Fix syntax error in ERB template for fastcgi location. #1168

merged 1 commit into from
Jan 10, 2018

Conversation

rpasing
Copy link
Contributor

@rpasing rpasing commented Jan 10, 2018

Fix syntax error in ERB template for fastcgi location.

This commit fixes a syntax error in the generated ruby script of this erb file.
Using ruby version 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux] and erb version erb.rb [2.1.0 2017-12-22], the erb template was being converted into the following ruby code:

 if defined? @fastcgi_script 
# this setting can be overridden by setting it in the fastcgi_param hash too ; _erbout.<<(-"\n"
);  @fastcgi_param = { 'SCRIPT_FILENAME' => @fastcgi_script }.merge(@fastcgi_param || {}) 
 end 

which resulted in the following error when doing a syntax check with ruby -c:

-:19: syntax error, unexpected ')'
);  @fastcgi_param = { 'SCRIPT...
^

With this commit applied, the converted ruby code will look like this:

 if defined? @fastcgi_script
_erbout.<<(-"    "); _erbout.<<(-"\n"
);  @fastcgi_param = { 'SCRIPT_FILENAME' => @fastcgi_script }.merge(@fastcgi_param || {})
 end

which is now correct ruby code.

This commit fixes a syntax error in the generated ruby script of this erb file.
Using ruby version `2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]` and erb version `erb.rb [2.1.0 2017-12-22]`,
the erb template was being converted into the following ruby code:
```
 if defined? @fastcgi_script
);  @fastcgi_param = { 'SCRIPT_FILENAME' => @fastcgi_script }.merge(@fastcgi_param || {})
 end
```
which resulted in the following error when doing a syntax check with `ruby -c`:
```
-:19: syntax error, unexpected ')'
);  @fastcgi_param = { 'SCRIPT...
^
```

With this commit applied, the converted ruby code will look like this:
```
 if defined? @fastcgi_script
_erbout.<<(-"    "); _erbout.<<(-"\n"
);  @fastcgi_param = { 'SCRIPT_FILENAME' => @fastcgi_script }.merge(@fastcgi_param || {})
 end
```
which is now correct ruby code.
@alexjfisher alexjfisher added the bug Something isn't working label Jan 10, 2018
@alexjfisher alexjfisher merged commit 6680341 into voxpupuli:master Jan 10, 2018
@alexjfisher
Copy link
Member

@rpasing Thanks!

Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
Fix syntax error in ERB template for fastcgi location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants