ruby-on-rails - Rails 4.2.0.rc1 升级 <module:InheritedResources>': 未初始化的常量 ActionController::Responder (NameError)

标签 ruby-on-rails activeadmin upgrade ruby-on-rails-4.2

在我尝试从 4.1.8 升级到 rails 4.2.0.rc1 时,我在运行服务器时收到以下错误:

joshRpowell@Joshuas-MacBook-Air:~/MyProjects/rentlit-app[hook]$ rails s
/Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/inherited_resources-1.5.1/lib/inherited_resources/responder.rb:2:in `<module:InheritedResources>': uninitialized constant ActionController::Responder (NameError)
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/inherited_resources-1.5.1/lib/inherited_resources/responder.rb:1:in `<top (required)>'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/inherited_resources-1.5.1/lib/inherited_resources.rb:4:in `<top (required)>'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/bundler/gems/active_admin-951f35d6799a/lib/active_admin.rb:10:in `<top (required)>'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/bundler/gems/active_admin-951f35d6799a/lib/activeadmin.rb:1:in `require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/bundler/gems/active_admin-951f35d6799a/lib/activeadmin.rb:1:in `<top (required)>'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `each'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:72:in `block in require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `each'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler/runtime.rb:61:in `require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.7/lib/bundler.rb:133:in `require'
from /Users/joshRpowell/MyProjects/rentlit-app/config/application.rb:7:in `<top (required)>'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/joshRpowell/.rvm/gems/ruby-2.1.5@rails4.2/gems/railties-4.2.0.rc1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

在我的 application.rb 文件中,我有以下内容:
require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

module Rentlit
  class Application < Rails::Application

    config.generators.helper = false
    config.generators.assets = false
    config.generators.view_specs = false
  end
end

有关如何排除故障的任何建议?

最佳答案

他们已经解决了: https://github.com/josevalim/inherited_resources/commit/6d034d913bfd9b53ea2e5b31c4056578a1b170a4 。我正在使用 Rails 4.2.1 的最新 gem 版本,它工作正常。

对于遇到问题的任何人,请尝试 bundle update inherited_resources

旧答案:

您必须使用 rails 4.2 的特定分支:

gem 'inherited_resources', github: 'josevalim/inherited_resources', branch: 'rails-4-2'

关于ruby-on-rails - Rails 4.2.0.rc1 升级 <module:InheritedResources>': 未初始化的常量 ActionController::Responder (NameError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27275301/

相关文章:

ruby-on-rails - 为 nil :NilClass using nested_form_for 获取未定义的方法 `values_at'

ruby-on-rails - 在Ruby中使用 Elasticsearch gem时在哪里指定集群详细信息

javascript - Rails 3.2/Active Admin - 自定义 Assets 管道路径不起作用,导致 ActionView::Template::Error (file.js 未预编译)

delphi - 有什么好的论据可以说服管理层升级到 Delphi 2009/2010?

ruby-on-rails - 设计:不允许的参数

ruby-on-rails - rails3上的注意和错误

ruby-on-rails - Show 方法中的 ActiveAdmin 显示集合

ruby-on-rails - ActiveAdmin 显示默认查看内容

clickonce - 为什么我的 ClickOnce 应用程序在部署新版本后第一次打开应用程序时没有识别出升级?

php - 使用 yum 在 CentOS 上将 PHP 升级到 5.2.12