skip to Main Content

i’ve followed https://www.process.st/telegram-bot/ steps for creating a telegram bot. an absolute beginner to coding and i can’t seem to get my bot to respond at all even after renaming the file.

Traceback (most recent call last):
    2: from bot.rb:1:in `<main>'
    1: from /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': cannot load such file -- telegramtest_bot (LoadError)```

2

Answers


  1. Looking over the tutorial, it looks like the gem is "telegram_bot" and not "telegramtest_bot". Gem requirees are exact wording.

    e.g. require "nokogiri"

    Additionally, you can version the gem in your gemfile.

    This post seems to be a good overview of how "require" works: https://www.educba.com/ruby-require/

    Login or Signup to reply.
  2. You can try the following in order to resolve it (for windows users):

    1. Navigate to your telegram bot folder
    2. Install bundle
    3. run ruby bot.rb

    Worked for me when i did that! enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search