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

Fix NameError in v2 push_message due to missing VERSION constant #379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tatematsu-k
Copy link

Summary

When using Line::Bot::V2::MessagingApi::ApiClient#push_message_with_http_info, a NameError occurs due to an uninitialized constant Line::Bot::V2::VERSION.

Reproduction Steps

  1. Use the line-bot-api gem with commit ref 5bc759e0a38f4eec5715a5504463147cdffec945
  2. Execute the following script:
   # Gemfile
   gem "line-bot-api", git: "https://github.com/line/line-bot-sdk-ruby.git", ref: "5bc759e0a38f4eec5715a5504463147cdffec945"

   line_retry_key = SecureRandom.uuid
   push_message_request = {
     to: "U123456789",
     messages: [{ ... }]
   }
   client = Line::Bot::V2::MessagingApi::ApiClient.new(channel_access_token: ENV["LINE_MESSAGING_CHANNEL_TOKEN"])
   response, status_code = client.push_message_with_http_info(push_message_request:, x_line_retry_key: line_retry_key)
  1. The following error occurs:
'Class#new': uninitialized constant Line::Bot::V2::VERSION (NameError)

          @http_headers = { 'User-Agent' => "LINE-BotSDK-Ruby/#{Line::Bot::V2::VERSION}" }.merge(http_headers)
                                                                             ^^^^^^^^^
	# ... backtrace for Rails Application

app(dev)> Line::Bot::V2::VERSION
(app):17:in '<main>': uninitialized constant Line::Bot::V2::VERSION (NameError)

@CLAassistant
Copy link

CLAassistant commented Feb 5, 2025

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants