Rails 4.2.0.rc1 upgrade <module: InheritedResources> ': uninitialized constant ActionController:: Responder (NameError)

В моей попытке перейти на rails 4.2.0.rc1 из 4.1.8 я получаю следующую ошибку при запуске сервера:

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 `</top></top></top></top></top></top></module:inheritedresources><main><code>'</code>
<p>В моем файле application.rb у меня есть следующее:</p>
<pre class="prettyprint linenums">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

Любые предложения по устранению неполадок?

3 ответа

Они уже решили это: https://github.com/josevalim/inherited_resources/commit/6***************************************. Я использую последнюю версию gem с рельсами 4.2.1, и она работает нормально.

Для тех, кто испытывает проблему, попробуйте bundle update inherited_resources.

Старый ответ:

Вы должны использовать конкретную ветку для рельсов 4.2:

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


Я не совсем уверен здесь, но я знаю, что action_controller/metal/responder.rb был удален из рельсов в 4.2 и почти сразу скопирован в responders gem action_controller/responder.rb. Вы можете попробовать добавить gem 'responders', '~> 2.0' в свой Gemfile, чтобы узнать, исправляет ли он это.

FWIW:


На данный момент просто запустите

bundle update inherited_resources

licensed under cc by-sa 3.0 with attribution.