hashicorp / vault-ruby

The official Ruby client for HashiCorp's Vault
Mozilla Public License 2.0
341 stars 136 forks source link

Syntax error with latest version 0.14.0 #237

Open castro1688 opened 4 years ago

castro1688 commented 4 years ago

The latest release is throwing syntax errors

/usr/local/share/gems/gems/vault-0.14.0/lib/vault/api.rb:12:in `require_relative': /usr/local/share/gems/gems/vault-0.14.0/lib/vault/api/transform.rb:14: syntax error, unexpected ',' (SyntaxError)
    def encode(role_name:, **opts)
                          ^
/usr/local/share/gems/gems/vault-0.14.0/lib/vault/api/transform.rb:19: syntax error, unexpected ','
    def decode(role_name:, **opts)
                          ^
/usr/local/share/gems/gems/vault-0.14.0/lib/vault/api/transform.rb:23: syntax error, unexpected keyword_end, expecting end-of-input
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault/api.rb:12:in `<module:API>'
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault/api.rb:2:in `<module:Vault>'
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault/api.rb:1:in `<top (required)>'
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault.rb:9:in `require_relative'
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault.rb:9:in `<module:Vault>'
    from /usr/local/share/gems/gems/vault-0.14.0/lib/vault.rb:1:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /XXXXXXXXXXX.rb:9:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /XXXXXXXXXXX:9:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /XXXXXXXXXXX.rb:13:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /XXXXXXXXXXX.rb:13:in `<main>'
laserguy2020 commented 3 years ago

Same issue with 0.15.0

Valarissa commented 3 years ago

Can I ask what version of Ruby you are both using?

Valarissa commented 3 years ago

I ask because this syntax is valid as of Ruby 2.0 https://thoughtbot.com/blog/ruby-2-keyword-arguments and Ruby 1.9.3 was EOL'd back in 2015: https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/

laserguy2020 commented 3 years ago

ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

laserguy2020 commented 3 years ago

I have no issues with 0.13.0 but 0.14.0 and 0.15.0 I run into this issue.

Valarissa commented 3 years ago

Are you certain that the version of ruby that is running the code isn't a distribution provided ruby? I ask this because I still have passing tests and am able to manually test with the same version of Ruby and a syntax error would most definitely not allow tests to pass since the code is loaded and parsed successfully.

laserguy2020 commented 3 years ago

It was a CentOS provided Ruby

Valarissa commented 3 years ago

So, confirming, are you saying that the code was running on a different version of Ruby? Or are you saying that the 2.7.0p0 was provided by CentOS?

laserguy2020 commented 3 years ago

I am saying the 2.7.0p0 was provided by CentOS

Valarissa commented 3 years ago

Are you able to pull the code here and run bundle exec rspec? Does the issues present itself there?

laserguy2020 commented 3 years ago

What do you want me to run rspec on? Do you mean this library?

Valarissa commented 3 years ago

Yup! Just to see what kind of outputs you get from running the tests for vault ruby, because I'm not able to reproduce.

laserguy2020 commented 3 years ago

I will do this first thing in the morning :)