Gem Not Autoloaded - Requires Manual require "toon"
Summary
After installing toon-ruby via the Gemfile and running bundle install, the gem is not autoloaded by Ruby/Rails. Attempting to call Toon.encode results in:
NameError: uninitialized constant Toon
This happens because the gem does not automatically require its main file.
Users must manually add:
in config/application.rb or before using the gem.
🔍 Expected Behavior
When a gem is added to the Gemfile and installed, it should automatically require the main library file, so developers can immediately do:
just like with most Ruby gems.
🧪 Actual Behavior
Without a manual require, Rails and Ruby applications cannot find the Toon constant.
Steps to Reproduce
-
Add toon-ruby to Gemfile:
-
Run bundle install
-
Attempt to use the gem:
Toon.encode("some string")
-
Result: NameError: uninitialized constant Toon
-
Workaround: Manually add require "toon" to config/application.rb or before usage
Environment
- Ruby version: [Your Ruby version]
- Rails version: [Your Rails version if applicable]
- toon-ruby version: [Version you're using]
Additional Context
Most Ruby gems automatically require their main library file when added to the Gemfile, making them immediately available. This gem requires an additional manual step that could be automated.
Gem Not Autoloaded - Requires Manual
require "toon"Summary
After installing
toon-rubyvia the Gemfile and runningbundle install, the gem is not autoloaded by Ruby/Rails. Attempting to callToon.encoderesults in:This happens because the gem does not automatically require its main file.
Users must manually add:
in
config/application.rbor before using the gem.🔍 Expected Behavior
When a gem is added to the Gemfile and installed, it should automatically require the main library file, so developers can immediately do:
just like with most Ruby gems.
🧪 Actual Behavior
Without a manual
require, Rails and Ruby applications cannot find theToonconstant.Steps to Reproduce
Add
toon-rubytoGemfile:Run
bundle installAttempt to use the gem:
Result:
NameError: uninitialized constant ToonWorkaround: Manually add
require "toon"toconfig/application.rbor before usageEnvironment
Additional Context
Most Ruby gems automatically require their main library file when added to the Gemfile, making them immediately available. This gem requires an additional manual step that could be automated.