试图在Ruby上安装Ruby时的Error7.0.0

问题描述 投票:0回答:2
这是错误:

/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'

如果你能帮助我,我会感激

错误的错误

设计的版本您正在使用调用一种名为

reference
ruby-on-rails ruby devise rubygems
2个回答
24
投票
https://github.com/heartcombo/devise/blob/c82e4cf47b02002b2fd7ca31d4441cf1043fc634c/lib/devise.rb#l320-l32323.

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

该方法存在于Rails 6:

https://github.com/rails/rails/blob/6-0-stable/activeupport/lib/active_support/depperencies.rb#l651-l653
在Rails 7中已删除:

https://github.com/rails/rails/blob/main/activeupport/lib/active_support/deppencortencies.rb

这条线从铁路7.0.0.Alpha1 ChangElog解释。 protivate内部类别的ActiveSupport ::依赖项已被删除,例如ActiveSupport :: Dependencies ::参考,ActiveSupport :: Dependencies :: dependencies :: Blookable等。

https://github.com/rails/rails/blob/main/activeupport/changelog.md#rails-700alpha1-september-15-2021 fix:升级设计 devise已发行了与Rails 7的4.8.1

版本。运行

bundle update devise

升级。

此修复程序修复了我的错误:

GEM“设计”,Github:“ Strobilomyces/Deakise”,分支:“ Patch-1”

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

devise已经将此问题与Rails 7合并到其主要分支机构。
在发布新版本后,您可以指出设计宝石在您的Gemfile中使用GitHub的主要分支:


1
投票

我已经升级了轨道6.1至7.2。 我正在错误 .rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in`require':无法加载此类文件-Devise_helper(loaderror)

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.