设计在 Rails 4.2 升级中引发错误 [英] Devise raises error with Rails 4.2 upgrade
问题描述
当我运行 rails s
时:
/Users/galli01anthony/.rvm/gems/ruby-2.1.3/gems/devise-3.2.4/lib/devise/rails/routes.rb:455:in
`ensure in with_devise_exclusive_scope': undefined method `merge!' for
#<ActionDispatch::Routing::Mapper::Scope:0x007f8743e19020> (NoMethodError)
当我运行 rake db:reset
或 db:migrate
或 db:setup
时:
When I run rake db:reset
or db:migrate
or db:setup
:
rake aborted!
NoMethodError: undefined method `merge!' for #<ActionDispatch::Routing::Mapper::Scope:0x007fca8d3f2780>
推荐答案
这个问题似乎已经通过这个 PR 解决了 https://github.com/plataformatec/devise/pull/3153 不久前.更新应用程序中的设计 gem(如果可能).
It seems like the issue was fixed with this PR https://github.com/plataformatec/devise/pull/3153 a while ago. Update the devise gem in your application (if possible).
将 Gemfile
中的 devise 版本更改为至少 3.4.0:
Change the version of devise in your Gemfile
to at least 3.4.0:
gem 'devise', '~> 3.4.0' # or later
然后运行:
bundle update devise
<小时>
更新:Devise 不久前更新到 3.5.x
版本,4.0
将很快发布(查看 RubyGems.org).也就是说,您可能希望在 Gemfile
中至少定义一个版本 3.5.x
:
Update: Devise was updated to version 3.5.x
a while ago and 4.0
will be released soon (see all version on RubyGems.org). That said you may want to define at least a version 3.5.x
in your Gemfile
:
gem 'devise', '~> 3.5.0'
或者只是加载可能的最新版本:
Or just load the newest version that is possible:
gem 'devise', '> 3.4'
跟随捆绑更新设计
这篇关于设计在 Rails 4.2 升级中引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!