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

Bullet gem pulls the latest dependency of "Uniform Notifier" which dropped support for Growl. #617

Open
granowski-bamboo opened this issue Mar 24, 2022 · 6 comments

Comments

@granowski-bamboo
Copy link

When I was running this app I have at this company I work for, we were doing our typical workflow and came across this:

/-----CENSORED-----/config/environments/development.rb:67:in block (2 levels) in <main>': undefined method growl=' for Bullet:Module (NoMethodError)

Turns out as of about 8 hours ago:

flyerhzm/uniform_notifier@dd6cc19

"drop growl support" was committed to the uniform_notifier library.

When I use version 1.14.2 of uniform_notifier, the app works, the bullet gem is fine.
When I use version 1.16.0 the app startup blows up cause the growl= method is gone.

A simple answer could be to fix the uniform_notifier dependency for bullet.
But it looks like some deprecation is underway, so a new version of bullet probably needs to be released.

We're using bullet gem 6.1.4 in this app I work on.
So I imagine a patch? One that rolls up to the version 7 or something...?

@flyerhzm
Copy link
Owner

@granowski-bamboo I don't know what patch do you expect, I just updated README to say

Growl support is dropped from uniform_notifier 1.16.0, if you still want it, please use uniform_notifier 1.15.0.

@granowski-bamboo
Copy link
Author

A co-worker suggested I open as issue cause the expectation is that usually dependencies are pinned with versions along with semantic versioning expectations.

We didn't expect that the uniform_notifier would drop growl support and break our code (which only references the bullet library directly).

I think we're mostly opening this issue just to let you know that people's ruby apps will break randomly because the uniform_notifier dependency will upgrade itself if the dependency is not locked down to version approximately 1.14.x.

@granowski-bamboo
Copy link
Author

s.add_runtime_dependency 'uniform_notifier', '~> 1.11'

I imagine that needs to say
s.add_runtime_dependency 'uniform_notifier', '<= 1.14'

And in version 7+'s branch you could have something like
s.add_runtime_dependency 'uniform_notifier', '>= 1.16.0'

@granowski-bamboo
Copy link
Author

I honestly don't know what the answer is here, I'm no rubyist expert... rofl.
Feel free to take the suggestion at will, and close the issue.
I think we've raised the awareness that people's code will break when the dependency of the library upgrades automatically.
Typical problem of npm-like and gem library trees.

@jacob-ablowitz
Copy link

jacob-ablowitz commented Apr 7, 2022

POSTING THIS FOR ANYONE ELSE WHO RUNS ACROSS THIS PROBLEM:

I don't use uniform_notifier at all, I have bullet included in the :development section of my Gemfile without any versioning constraints:

group :development do
  gem 'brakeman', require: false
  gem 'guard-brakeman'
  gem 'listen', '~> 3'
  gem 'bullet'
  gem 'guard-rspec', require: false
  gem 'spring'
  gem 'spring-commands-rspec'
  gem 'spring-watcher-listen', '~> 2'
end

I just ran bundle update; now my development environment cannot start up due to a NoMethodError with growl:

web      | [454] Puma starting in cluster mode...
web      | [454] * Puma version: 5.6.4 (ruby 2.7.2-p137) ("Birdie's Version")
web      | [454] *  Min threads: 5
web      | [454] *  Max threads: 8
web      | [454] *  Environment: development
web      | [454] *   Master PID: 454
web      | [454] *      Workers: 2
web      | [454] *     Restarts: (✔) hot (✖) phased
web      | [454] * Preloading application
web      | [454] ! Unable to load application: NoMethodError: undefined method `growl=' for Bullet:Module
web      | Traceback (most recent call last):
web      | 	37: from /bundle/ruby/2.7.0/bin/puma:23:in `<main>'
web      | 	36: from /bundle/ruby/2.7.0/bin/puma:23:in `load'
web      | 	35: from /bundle/ruby/2.7.0/gems/puma-5.6.4/bin/puma:10:in `<top (required)>'
web      | 	34: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/cli.rb:81:in `run'
web      | 	33: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/launcher.rb:182:in `run'
web      | 	32: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/cluster.rb:357:in `run'
web      | 	31: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/runner.rb:150:in `load_and_bind'
web      | 	30: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/configuration.rb:270:in `app'
web      | 	29: from /bundle/ruby/2.7.0/gems/puma-5.6.4/lib/puma/configuration.rb:348:in `load_rackup'
web      | 	28: from /bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
web      | 	27: from /bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
web      | 	26: from /bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
web      | 	25: from /bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
web      | 	24: from config.ru:5:in `block in <main>'
web      | 	23: from config.ru:5:in `require_relative'
web      | 	22: from /myapp/config/environment.rb:5:in `<top (required)>'
web      | 	21: from /bundle/ruby/2.7.0/gems/railties-6.1.5/lib/rails/application.rb:391:in `initialize!'
<snipped out remainder of stack trace given it's not likely relevant>

Rails version 6.1.5

Locking bullet to 6 wasn't enough, as my bundle update had already installed uniform-notifier 1.16.0. I had to explicitly limit versions of both bullet and uniform_notifier in my Gemfile:

...
  gem 'bullet', '~> 6'
  gem 'uniform_notifier', '<= 1.15'
...

After this, I deleted vendor/cache/uniform_notifier-1.16.0.gem and ran bundle update again. After this, my server was able to load and run.

There seems to be something in bullet 7.0.1 that is still referencing growl, @flyerhzm . Hope the above stack trace is helpful in isolating and removing it as appropriate!

@flyerhzm
Copy link
Owner

@jacob-ablowitz this looks weird, I have removed the growl from both uniform_notifier and bullet.

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

3 participants