Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!