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

Use Rails global constant #761

Closed
wants to merge 1 commit into from

Conversation

RStankov
Copy link

When I updated my application to Ruby 3.2.2 I start getting the following error

 undefined method `gem_version' for Flipper::Rails:Module (NoMethodError)

From this line

COLOR_OPTIONS = if Rails.gem_version > Gem::Version.new('7.0.99')

The reason is that Rails in this context is mistaken for Flipper::Rails instead of the global Rails.

This fixes mistaking `Flipper::Rails for `Rails` errors:

```
 undefined method `gem_version' for Flipper::Rails:Module (NoMethodError)
```

At:

```ruby
COLOR_OPTIONS = if Rails.gem_version > Gem::Version.new('7.0.99')
```
@jnunemaker
Copy link
Collaborator

Weird that it would do that. Doesn't seem to be happening for me on 3.2.2. That said, I don't think this can hurt anything and maybe it helps.

@bkeepers any thoughts?

@bkeepers
Copy link
Collaborator

@RStankov Are you by chance using the old flipper-rails gem? We don't define Flipper::Rails anywhere, so I'm not sure where else that would be coming from.

@RStankov
Copy link
Author

RStankov commented Sep 19, 2023

Yes, I'm using flipper-rails. I didn't know it isn't needed anymore

When I remove it, it fixes the issues and everything seems to work :)

@bkeepers
Copy link
Collaborator

@RStankov Great! flipper-rails was not an official gem and is deprecated.

@bkeepers
Copy link
Collaborator

Closing this since I don't think it's needed, but let me know if anyone feels otherwise.

@bkeepers bkeepers closed this Sep 20, 2023
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