telegram-bot icon indicating copy to clipboard operation
telegram-bot copied to clipboard

Rails 8.1 incompatilibity: undefined method 'config_accessor' for class Telegram::Bot::UpdatesController (NoMethodError)

Open mprokopov opened this issue 5 months ago • 5 comments

Hello, dear maintainers!

looks like the gem ain't compatible with Rails 8.1 beta.

.rbenv/versions/3.4.5/lib/ruby/gems/3.4.0/gems/telegram-bot-0.16.7/lib/telegram/bot/updates_controller/instrumentation.rb:12:in 'block in <module:Instrumentation>': undefined method 'config_accessor' for class Telegram::Bot::UpdatesController (NoMethodError)

Appreciate your efforts 🙇

mprokopov avatar Oct 08 '25 10:10 mprokopov

@mprokopov Found exactly the same problem, thx for the pull request. Would appreciate a merge.

thomaswitt avatar Oct 20 '25 16:10 thomaswitt

Rails 8.1 final results in

Because every version of telegram-bot depends on activesupport >= 4.0, < 8.1
  and activejob >= 8.1.0 depends on activesupport = 8.1.0,
  every version of telegram-bot is incompatible with activejob >= 8.1.0.
So, because Gemfile depends on activejob = 8.1.0
  and Gemfile depends on telegram-bot >= 0,
  version solving has failed.

@mprokopov I think you have to update the gemspec as well in the PR

thomaswitt avatar Oct 22 '25 10:10 thomaswitt

Good catch, @thomaswitt, thanks!

Dropped limiting conditions, let me know if it should be handled differently

mprokopov avatar Oct 22 '25 14:10 mprokopov

@mprokopov Do you also keep on getting " DEPRECATION WARNING: post received a hash argument to. Please use a keyword instead. Support to hash argument will be removed in Rails 8.2." when using telegram_webhook TelegramWebhooksController?

I guess it's because of https://github.com/telegram-bot-rb/telegram-bot/blob/master/lib/telegram/bot/routes_helper.rb and the params hash.

thomaswitt avatar Oct 24 '25 13:10 thomaswitt

Thanks @thomaswitt

dropped a fix for the warning to the same PR

mprokopov avatar Oct 25 '25 10:10 mprokopov