[v3] NameError (uninitialized constant Coconut)
Closed this issue · 2 comments
nerfologist commented
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.
brunoceleste commented
Hello Marco,
We just pushed a fix so you don't need to require "coconut" into the
Gemfile.
Please upgrade to 3.0.1.
Thanks!
Bruno Celeste
CTO & Co-founder
coconut.co
…On Mon, Apr 19, 2021 at 12:35 PM Marco Arduini ***@***.***> wrote:
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 ***@***.***
ruby-3.0.0 - #generating testcoconutv3 wrappers........
$ rvm use ***@***.***
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABRI7LIRPHR7YTVKHZYMTTJQBPZANCNFSM43FRUQ6A>
.
nerfologist commented
It works fine in v3.0.1, thanks a lot!