Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
Error when trying to install devise in Ruby on Rails 7.0.0

I'm trying to install devise in the rails version I get the error of the latest version of devise

I have tried with other devise versions but it is update it to the latest,

this is the error:

/usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:321:in `ref': undefined method `reference' for ActiveSupport::Dependencies:Module (NoMethodError)
web_1  |    from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:340:in `mailer='
web_1  |    from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:342:in `<module:Devise>'
web_1  |    from /usr/local/bundle/gems/devise-4.8.0/lib/devise.rb:11:in `<main>'
web_1  |    from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
web_1  |    from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
web_1  |    from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
web_1  |    from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
web_1  |    from /usr/local/bundle/gems/bootsnap-1.8.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
web_1  |    from /usr/local/bundle/gems/zeitwerk-2.5.0.beta3/lib/zeitwerk/kernel.rb:35:in `require'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:61:in `each'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:50:in `each'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler/runtime.rb:50:in `require'
web_1  |    from /usr/local/lib/ruby/3.0.0/bundler.rb:174:in `require'

if you could help me I'd be grateful

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Source of the Error

The version of Devise you're using calls a method named reference. https://github.com/heartcombo/devise/blob/c82e4cf47b02002b2fd7ca31d441cf1043fc634c/lib/devise.rb#L320-L323

def self.ref(arg)
  ActiveSupport::Dependencies.reference(arg)
  Getter.new(arg)
end

The method existed in Rails 6: https://github.com/rails/rails/blob/6-0-stable/activesupport/lib/active_support/dependencies.rb#L651-L653

It has been removed in Rails 7: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/dependencies.rb

This line from Rails 7.0.0.alpha1 changelog explains.

Private internal classes of ActiveSupport::Dependencies have been deleted, like ActiveSupport::Dependencies::Reference, ActiveSupport::Dependencies::Blamable, and others.

https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md#rails-700alpha1-september-15-2021

Fix: Upgrade Devise

Device has released a 4.8.1 version that's compatible with Rails 7. Run bundle update devise to upgrade.

over 4 years ago · Santiago Trujillo Relatório

0

Devise already merged the fix for this issue with rails 7 to their main branch.

Until a new version is released, you can point the devise gem to use the main branch from GitHub in your Gemfile:

gem 'devise', git: 'https://github.com/heartcombo/devise', branch: 'main'

over 4 years ago · Santiago Trujillo Relatório

0

This fix fixed my bug:

gem "devise", github: "strobilomyces/devise", branch: "patch-1"

https://github.com/heartcombo/devise/pull/5397

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda