Skip to content

uninitialized constant DeepL::VERSION in v3.6.1 #17

@341bms

Description

@341bms

Bug Report: uninitialized constant DeepL::VERSION in v3.6.1

Description

When configuring the DeepL gem in a Rails initializer, an uninitialized constant DeepL::VERSION (NameError) is raised during the DeepL.configure call. The error originates from lib/deepl/configuration.rb:49 in the construct_user_agent method.

Steps to Reproduce

  1. Add gem 'deepl-rb', require: 'deepl' to Gemfile
  2. Run bundle install
  3. Create an initializer config/initializers/deepl.rb with:
DeepL.configure do |config|
  config.auth_key = ENV['DEEPL_AUTH_KEY']
end
  1. Start the Rails server with rails s

Expected Behavior

The DeepL gem should configure successfully without errors.

Actual Behavior

The application fails to start with the following error:

/lib/deepl/configuration.rb:49:in `construct_user_agent': uninitialized constant DeepL::VERSION (NameError)

Full Stack Trace

/deepl-rb-3.6.1/lib/deepl.rb:155:in `configure'
/deepl-rb-3.6.1/lib/deepl.rb:151:in `configuration'
/deepl-rb-3.6.1/lib/deepl.rb:151:in `new'
/deepl-rb-3.6.1/lib/deepl/configuration.rb:27:in `initialize'
/deepl-rb-3.6.1/lib/deepl/configuration.rb:49:in `construct_user_agent'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions