Rails Problems about upgrade to Rails 4

bruceyue · 2013年08月20日 · 最后由 small_fish__ 回复于 2013年08月20日 · 2822 次阅读

When I run "rake db:migrate", the following errors occurred:

undefined method status_code' for classActionDispatch::ShowExceptions' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:in alias_method' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/core_ext/module/aliasing.rb:32:inalias_method_chain' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/will_paginate-3.0.2/lib/will_paginate/railtie.rb:40:in block in <module:ShowExceptionsPatch>' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/concern.rb:114:inclass_eval' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/concern.rb:114:in append_features' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/will_paginate-3.0.2/lib/will_paginate/railtie.rb:28:ininclude' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/will_paginate-3.0.2/lib/will_paginate/railtie.rb:28:in setup_actioncontroller' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/will_paginate-3.0.2/lib/will_paginate/railtie.rb:14:inblock (2 levels) in class:Railtie' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:inexecute_hook' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in block in on_load' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:ineach' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in on_load' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/will_paginate-3.0.2/lib/will_paginate/railtie.rb:13:inblock in class:Railtie' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in instance_exec' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:inrun' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in block in run_initializers' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:inrun_initializers' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in initialize!' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:inmethod_missing' /Users/Bruce/RoR/ShareAllTech/config/environment.rb:5:in <top (required)>' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inrequire' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in block in require' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:inload_dependency' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in require' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:inrequire_environment!' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:249:in block in run_tasks_blocks' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:ineval' /Users/Bruce/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `' Tasks: TOP => db:migrate => environment

I have solved this by adding gem 'will_paginate', '>=3.0.4'

这是国际友人吗??? :)

需要 登录 后方可回复, 如果你还没有账号请 注册新账号