简体   繁体   中英

Rails 4.1.0.beta1 upgrade fails

I recently tried to install rails 4.1.0.beta1 , but rails s results in the following error.

[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `graft' for class `ActiveRecord::Associations::JoinDependency' (NameError)
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method_chain'
[RVM]/gems/ruby-2.0.0-p247/gems/polyamorous-0.6.4/lib/polyamorous/join_dependency.rb:7:in `block in included'
[RVM]/gems/ruby-2.0.0-p247/gems/polyamorous-0.6.4/lib/polyamorous/join_dependency.rb:5:in `class_eval'
[RVM]/gems/ruby-2.0.0-p247/gems/polyamorous-0.6.4/lib/polyamorous/join_dependency.rb:5:in `included'
[RVM]/gems/ruby-2.0.0-p247/gems/polyamorous-0.6.4/lib/polyamorous.rb:20:in `include'
[RVM]/gems/ruby-2.0.0-p247/gems/polyamorous-0.6.4/lib/polyamorous.rb:20:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/ransack-1.1.0/lib/ransack/adapters/active_record/3.1/context.rb:3:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/ransack-1.1.0/lib/ransack/adapters/active_record/3.2/context.rb:2:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/ransack-1.1.0/lib/ransack/adapters/active_record/context.rb:2:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/ransack-1.1.0/lib/ransack/adapters/active_record.rb:12:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/ransack-1.1.0/lib/ransack.rb:22:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/bundler/gems/active_admin-85b9f8164809/lib/active_admin.rb:2:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:232:in `load_dependency'
[RVM]/gems/ruby-2.0.0-p247/gems/activesupport-4.1.0.beta1/lib/active_support/dependencies.rb:247:in `require'
[RVM]/gems/ruby-2.0.0-p247/bundler/gems/active_admin-85b9f8164809/lib/activeadmin.rb:1:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
[RAILS_ROOT}/config/application.rb:8:in `<top (required)>'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands/commands_tasks.rb:79:in `require'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands/commands_tasks.rb:79:in `block in server'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands/commands_tasks.rb:76:in `tap'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands/commands_tasks.rb:76:in `server'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
[RVM]/gems/ruby-2.0.0-p247/gems/railties-4.1.0.beta1/lib/rails/commands.rb:17:in `<top (required)>'

This is my current system.

  • ruby 2.0.0
  • rails 4.1.0.beta1

Why is it failing?

It's failing because of Ransack dependency's Polyamorous.

Here's an open issue in activerecord-hackery/polyamorous to keep an eye on https://github.com/activerecord-hackery/polyamorous/issues/6

UPDATE

To get it work with 4.1, put this in your Gemfile

gem 'formtastic', github: 'justinfrench/formtastic'
gem 'ransack', github: 'activerecord-hackery/ransack', branch: 'rails-4.1'
gem 'polyamorous', github: 'activerecord-hackery/polyamorous'
gem 'activeadmin', github: 'gregbell/active_admin'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM