Devise引发了Rails 4.2升级错误 [英] Devise raises error with Rails 4.2 upgrade

查看:93
本文介绍了Devise引发了Rails 4.2升级错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 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

rake aborted!
NoMethodError: undefined method `merge!' for #<ActionDispatch::Routing::Mapper::Scope:0x007fca8d3f2780>


推荐答案

似乎这个PR <一段时间前,href =https://github.com/plataformatec/devise/pull/3153 =noreferrer> https://github.com/plataformatec/devise/pull/3153 。更新应用程序中的devise 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 中的设计版本更改为至少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 3.5.x version in your Gemfile:

gem 'devise', '~> 3.5.0'

或者只是加载可能的最新版本:

Or just load the newest version that is possible:

gem 'devise', '> 3.4'

按照软件包更新设计

这篇关于Devise引发了Rails 4.2升级错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆