I’ve loaded a package in ruby but when I try to execute it, I get an error.
Please help!
Code:
require 'telegram/bot'
token = "REPLACE_WITH_ACTUAL_TOKEN"
Telegram::Bot::Client.run(token) do |bot|
end
Result:
undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
2
Answers
Issue here is not that your package is not loaded. But that class method
run
does not exist. You may want to check whether you have installed the latest version, not something old.Other than that, I can hardly imagine what could be going on.
The error message is pretty self-explanatory:
The error message is telling you that the method
Telegram::Bot::Client::run
does not exist, and both the documentation, the README, and the source code seem to agree that there is, indeed, no such method.