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

Version 1.10.0 not compatible with ruby 2.2.6 #93

Closed
aunghtain opened this issue Feb 28, 2024 · 8 comments
Closed

Version 1.10.0 not compatible with ruby 2.2.6 #93

aunghtain opened this issue Feb 28, 2024 · 8 comments
Assignees

Comments

@aunghtain
Copy link

Issue description

The latest version (1.10.0) with ruby 2.2.6 gives the following error.

/usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit.rb:16:in require': /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit/cron.rb:323: syntax error, unexpected tIDENTIFIER, expecting '<' or ';' or '\n' (SyntaxError) class CronIterator include ::Enumerable ^ from /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit.rb:16:in <top (required)>'

How to reproduce

I'm using it in rails with rufus-scheduler 3.6.0. After bundle install, I try to start rails console

rails c

I got the above error.

Error and error backtrace (if any)

/usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit.rb:16:in `require': /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit/cron.rb:323: syntax error, unexpected tIDENTIFIER, expecting '<' or ';' or '\n' (SyntaxError)
    class CronIterator include ::Enumerable
                              ^
        from /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit.rb:16:in `<top (required)>'

Expected behaviour

Rails starts console without any issues.

Context

Please replace the content of this section with the output of the following commands:

Linux XXXX 5.15.0-1051 #59~20.04.1-Ubuntu SMP Tue Oct 17 16:45:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
[:env_tz, nil]
(secs:1709141883.3072312,utc~:"2024-02-28 17:38:03.30723118782043457",ltz~:"PST")
(etz:nil,tnz:"PST",tziv:"0.3.62",tzidv:nil,rv:"2.2.6",rp:"x86_64-linux",win:false,rorv:nil,astz:nil,eov:"1.2.7",eotnz:#<TZInfo::DataTimezone: America/Los_Angeles>,eotnfz:"-0800",eotlzn:"America/Los_Angeles",eotnfZ:"PST",debian:"America/Los_Angeles",centos:nil,osx:"America/Los_Angeles")
/usr/share/rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit/cron.rb:323: syntax error, unexpected tIDENTIFIER, expecting '<' or ';' or '\n' (SyntaxError)
    class CronIterator include ::Enumerable
                              ^
        from /usr/share/rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/share/rvm/gems/ruby-2.2.6/gems/fugit-1.10.0/lib/fugit.rb:16:in `<top (required)>'
        from /usr/share/rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:130:in `require'
        from /usr/share/rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
        from /usr/share/rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:35:in `require'
[:now, 2024-02-28 09:38:03 -0800, :zone, "PST"]

Additional context

If I downgrade to 1.9.0, it works fine.

@jmettraux jmettraux self-assigned this Feb 28, 2024
@jmettraux
Copy link
Member

jmettraux added a commit that referenced this issue Feb 28, 2024
jmettraux added a commit that referenced this issue Feb 28, 2024
@jmettraux
Copy link
Member

https://github.com/floraison/fugit/actions/runs/8087932820/job/22100915876 no 2.2.6, but no luck with 2.2.10 :-(

@jmettraux
Copy link
Member

@aunghtain Hello and thanks for the detailed report!

I have trouble finding a Ruby 2.2.x or 2.2.6 to test directly, neither on GitHub Actions, neither for my development station (some kind of compile error). Could you please test this include Enumerable version on your Ruby 2.2.6 and tell me if that fixes it?

When we are successful, I will release a fugit 1.10.1.

@aunghtain
Copy link
Author

aunghtain commented Feb 28, 2024

It still gives me the same error.

/usr/share/rvm/gems/ruby-2.2.6/bundler/gems/fugit-4c12b6120f20/lib/fugit.rb:16:in `require': /usr/share/rvm/gems/ruby-2.2.6/bundler/gems/fugit-4c12b6120f20/lib/fugit/cron.rb:323: syntax error, unexpected tIDENTIFIER, expecting '<' or ';' or '\n' (SyntaxError)
    class CronIterator include Enumerable
                              ^

But if I move the include to a new line, it works fine.

    class CronIterator
      include Enumerable

Also, this works.

    class CronIterator
      include ::Enumerable

@jmettraux
Copy link
Member

Well done! I will change and release 1.10.1. Thanks a lot!

@jmettraux
Copy link
Member

jmettraux commented Feb 28, 2024

1.10.1 released https://rubygems.org/gems/fugit/versions/1.10.1

Please tell me if it works for you.

Thanks!

@aunghtain
Copy link
Author

1.10.1 works! Thank you so much @jmettraux

@jmettraux
Copy link
Member

@aunghtain You're welcome! Well done!

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

No branches or pull requests

2 participants