DomT4 / homebrew-autoupdate

:tropical_drink: An easy, convenient way to automatically update Homebrew.
BSD 2-Clause "Simplified" License
995 stars 55 forks source link

undefined method `[]' for Formula:Clas #31

Closed Tealk closed 3 years ago

Tealk commented 4 years ago

Hello, I am using MacOS 11 and get the following error message when executing the script:

brew autoupdate --start 86400 --enable-notification
Error: undefined method `[]' for Formula:Class
/usr/local/Homebrew/Library/Taps/domt4/homebrew-autoupdate/lib/autoupdate/notify.rb:6:in `notifier'
/usr/local/Homebrew/Library/Taps/domt4/homebrew-autoupdate/lib/autoupdate/start.rb:25:in `start'
/usr/local/Homebrew/Library/Taps/domt4/homebrew-autoupdate/cmd/brew-autoupdate.rb:35:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:85:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:115:in `<main>'
ruzickap commented 4 years ago

The same issue is on 10.5 when using the command brew autoupdate --start --upgrade --enable-notification.

The command is running fine with the --enable-notification.

Tealk commented 4 years ago

Oh right, the error occurs only when you chain commands together.

BrianAMartin221 commented 3 years ago

So should all the commands be run seperntly? I haven't been able to get this to work (with notifications) in the last two weeks.

So if you want all the "flags" on run all fo these commands?

brew autoupdate --start 43200

brew autoupdate --upgrade

brew autoupdate --cleanup

brew autoupdate --enable-notification

I feel like on my old OS i was able to run.

brew autoupdate --start 43200 --upgrade --cleanup --enable-notification

InjustFr commented 3 years ago

I've manage to chain all commands except --enable-notification. So just do brew autoupdate --start 43200 --upgrade --cleanup first and then brew autoupdate --enable-notification

BrianAMartin221 commented 3 years ago

Excellent trying that now

BrianAMartin221 commented 3 years ago

Hey I tried running the commands in the order you mentioned but haven't gotten a notification that its running on one of my machines running OS X Catalina (It is working on a different machine same commands, so def a homebrew issue on my end)

I tried uninstalling Brew and reinstalling but still haven't gotten the notification in the time frame or on restart.

brew autoupdate --status Autoupdate is installed and running

Anything I can try with the logs or commands to give it a kick

ghost commented 3 years ago

So should all the commands be run seperntly? I haven't been able to get this to work (with notifications) in the last two weeks.

So if you want all the "flags" on run all fo these commands?

brew autoupdate --start 43200

brew autoupdate --upgrade

brew autoupdate --cleanup

brew autoupdate --enable-notification

I feel like on my old OS i was able to run.

brew autoupdate --start 43200 --upgrade --cleanup --enable-notification

This does not work, it will not affect the generated updater script in ~/Library/Application Support/com.github.domt4.homebrew-autoupdate.

You need to --delete if you want to --start with different parameters, else the updater script is not updated.

BrianAMartin221 commented 3 years ago

Sorry I'm lost here.

I have run the brew autoupdate --delete command before setting new peramaters, but after doing that should I run all of those commands one at a time

brew autoupdate --start 43200 brew autoupdate --upgrade

ect..

I tried running them all together without notification and running brew autoupdate --enable-notification by itself afterwards but I am still not getting notifications.

InjustFr commented 3 years ago

From what I can gather, right now you can't run it with notifications. Either you run the script and don't get notifications or you just don't run it and wait for a fix

But in case you want to run it, it works. I have noticed my packages getting updated

DomT4 commented 3 years ago

https://github.com/DomT4/homebrew-autoupdate/pull/32#issuecomment-709678688

Some explanation there on the wait time. Does anyone still have issues after doing brew update and running the autoupdate script with --enable-notification enabled?

will-ks commented 3 years ago

Works for me, thanks!