Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problem for edge: Zeitwerk::NameError: wrong constant name Refinerycms-authentication-devise inferred by Module from file #3479

Open
timreganporter opened this issue Jul 27, 2020 · 6 comments

Comments

@timreganporter
Copy link

I'm doing a fresh install, using Rails 6.0.3.2 and Ruby 2.7.1.

Using: rails new rickrockstar -m https://www.refinerycms.com/t/edge

  • Bundle install seems to work but then the installation croaks on db:create with:
    Zeitwerk::NameError: wrong constant name Refinerycms-authentication-devise inferred by Module from file
    The relevant line in the Gemfile is:
    gem 'refinerycms-authentication-devise', git: 'https://github.com/refinery/refinerycms-authentication-dev

  • I tried changing the Gemfile entry to:
    gem 'refinerycms-authentication-devise', '~> 2.0.0'

and got this (which is similar to the error I get when installing from the 4.0 templates:

 In Gemfile:
    rails (~> 6.0.3, >= 6.0.3.2) was resolved to 6.0.3.2, which depends on
      actionmailer (= 6.0.3.2)

    refinerycms-authentication-devise (~> 2.0.0) was resolved to 2.0.0, which depends on
      actionmailer (< 5.2, >= 5.0.0)
@jenxi
Copy link

jenxi commented Aug 6, 2020

I'm getting the same error with the same versions of Rails and Ruby.

Same issue when I try installing the edge version.

@Pauloparakleto
Copy link

@jenxi n @timreganporter It had happened to me. As I needed a rails 6, I changed to confortable mexican sofa.
If you can handle rails 5, you may also try Lines gem from opoolo.

@jussihirvi
Copy link
Contributor

jussihirvi commented Nov 17, 2020

Same error (ruby 2.6.5, rails 6.0.3.4). I got around it by adding this to the new application's config/application.rb:

# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.autoloader = :classic

Just like in this template file.

Then I navigated to the new app and run manually the commands inferred from www.refinerycms.com/t/edge:

rake db:create
rails generate refinery:cms --fresh-installation

That complained about a syntax error in Gemfile, but it was easy to fix, and then I run the generate command again.

@bumper21
Copy link

bumper21 commented Nov 19, 2020

Same error (ruby 2.6.5, rails 6.0.3.4). I got around it by adding this to the new application's config/application.rb:

# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.autoloader = :classic

Just like in this template file.

Then I navigated to the new app and run manually the commands inferred from www.refinerycms.com/t/edge:

rake db:create
rails generate refinery:cms --fresh-installation

That complained about a syntax error in Gemfile, but it was easy to fix, and then I run the generate command again.

Thanks for this @jussihirvi, I'm new to Refinery (literally just checking it out now) and i could not figure out why I was getting the Zeitwerk error. Your solution worked for me.
One question though, will the config.autoloader being set to classic create any other issues within the refinery setup?

Edit: I'm using Rails 6.0.3.4 and Ruby 2.7.1

@jussihirvi
Copy link
Contributor

jussihirvi commented Nov 19, 2020

Bumper21, probably the setting will cause no problems because it is already used in a template file in the master branch.

However, a bug fix is on it's way, to allow the zeitwerk autoloader, as bricesanchez told here.

@parndt
Copy link
Member

parndt commented Jul 15, 2021

You can follow along at #3465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants