When starting the Rails application in the application exits with a NameError stating uninitialized constant Langchain::LLM::Adapter. This error seems to be related to the Langchain gem (0.17.1) or autoloading during the eager loading process.
To Reproduce
Set up a Rails 6.0.6.1 application with the Langchain gem installed (version 0.17.1).
Start the application using Puma as the web server.
The application exits with the error before starting properly.
Expected behavior
The Rails application should start successfully without raising a NameError and remain running in development mode.
Terminal commands & output
Commands used:
rails server -b 0.0.0.0
Output:
=> Booting Puma
=> Rails 6.0.6.1 application starting in development
=> Run `rails server --help` for more startup options
Exiting
/usr/local/bundle/gems/zeitwerk-2.6.18/lib/zeitwerk/cref.rb:91:in `const_get': uninitialized constant Langchain::LLM::Adapter (NameError)
from /usr/local/bundle/gems/zeitwerk-2.6.18/lib/zeitwerk/cref.rb:91:in `get'
from /usr/local/bundle/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/eager_load.rb:173:in `block in actual_eager_load_dir'
...
from bin/rails:4:in `<main>'
Describe the bug
When starting the Rails application in the application exits with a
NameError
statinguninitialized constant Langchain::LLM::Adapter
. This error seems to be related to theLangchain
gem (0.17.1) or autoloading during the eager loading process.To Reproduce
Langchain
gem installed (version 0.17.1).Expected behavior
The Rails application should start successfully without raising a
NameError
and remain running in development mode.Terminal commands & output
Commands used:
Output:
System: