opencoconut/coconutrb

[v3] NameError (uninitialized constant Coconut)

Closed this issue · 2 comments

Hello, and thanks for this library. I really love the API.

In my company, we are upgrading from coconutrb 2.4.0 to 3.0.0. Unfortunately, despite adding the coconutrb gem to the Gemfile and bundling, the Coconut constant is uninitialized. I was able to reproduce the issue in a fresh Rails app:

How to reproduce


$ rvm gemset create testcoconutv3
ruby-3.0.0 - #gemset created /Users/marco/.rvm/gems/ruby-3.0.0@testcoconutv3
ruby-3.0.0 - #generating testcoconutv3 wrappers........
$ rvm use default@testcoconutv3
Using /Users/marco/.rvm/gems/ruby-3.0.0 with gemset testcoconutv3
$ gem install rails
...
$ rails new testcoconutv3
...
$ cd testcoconutv3/
$ echo "gem 'coconutrb', '~> 3.0.0'" >> Gemfile
$ bundle
...
$ bin/rails c
Running via Spring preloader in process 98394
Loading development environment (Rails 6.1.3.1)
3.0.0 :001 > Coconut
Traceback (most recent call last):
        1: from (irb):1:in `<main>'
NameError (uninitialized constant Coconut)
3.0.0 :002 >

Am I doing something wrong or is the Coconut variable not available as it should?

In the original application, I was trying to set Coconut config values in an initializer in config/initializers/coconut.rb when I ran into the same problem.

It works fine in v3.0.1, thanks a lot!