gpt4 book ai didi

ruby-on-rails - 迁移错误 : undefined method `cache' for Gem:Module

转载 作者:数据小太阳 更新时间:2023-10-29 07:45:09 25 4
gpt4 key购买 nike

通过 Rails 应用程序迁移时出现此错误

undefined method `cache' for Gem:Module

正在使用

Rails 3.2.9

Ruby 1.8.7

Ubuntu 12.04

rake db:migrate --trace

/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/object.rb:138: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/symbol.rb:3: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/time.rb:41: warning: method redefined; discarding old to_datetime
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/boolean.rb:2: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/boolean.rb:8: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/module.rb:14: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/nil.rb:2: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/extlib-0.9.15/lib/extlib/numeric.rb:2: warning: method redefined; discarding old try_dup
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:477: warning: method redefined; discarding old orm
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:494: warning: method redefined; discarding old test_framework
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:510: warning: method redefined; discarding old template_engine
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/core_ext/kernel.rb:15: warning: (...) interpreted as grouped expression
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:620: warning: `*' interpreted as argument prefix
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/controller/abstract_controller.rb:195: warning: redefine _template_root=
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/gem_ext/erubis.rb:9: warning: method redefined; discarding old convert_input
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/config.rb:158: warning: instance variable @configuration not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
Merb root at: /home/rajendran/projects/myapp
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:310: warning: instance variable @root not initialized
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/core_ext.rb:43: warning: method redefined; discarding old to_time
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old text_field
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old password_field
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old hidden_field
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old file_field
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old text_area
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old select
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old check_box
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old radio_button
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/form/helpers.rb:346: warning: method redefined; discarding old radio_group
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/tag_helpers.rb:28: warning: method redefined; discarding old tag
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/tag_helpers.rb:38: warning: method redefined; discarding old open_tag
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/tag_helpers.rb:43: warning: method redefined; discarding old close_tag
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-helpers-1.1.3/lib/merb-helpers/tag_helpers.rb:51: warning: method redefined; discarding old self_closing_tag
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-mailer-1.1.3/lib/merb-mailer/mailer.rb:104: warning: `*' interpreted as argument prefix
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/actions/action.rb:7: warning: method redefined; discarding old source=
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/actions/action.rb:13: warning: method redefined; discarding old destination=
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/generator.rb:596: warning: method redefined; discarding old destination_root
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/core_ext/kernel.rb:3: warning: method redefined; discarding old instance_exec
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-gen-1.1.3/lib/merb-gen/templater.rb:4: warning: method redefined; discarding old identical?
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-gen-1.1.3/lib/merb-gen/templater.rb:25: warning: method redefined; discarding old invoke!
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-gen-1.1.3/lib/merb-gen/templater.rb:34: warning: method redefined; discarding old revoke!
rake aborted!
undefined method `cache' for Gem:Module
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/discovery.rb:62:in `find_latest_gem_paths'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/discovery.rb:73:in `generator_files'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/templater-1.0.0/lib/templater/discovery.rb:48:in `discover!'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-gen-1.1.3/lib/merb-gen.rb:32
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `require'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:400:in `load_dependencies'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core/bootloader.rb:375:in `run'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/merb-core-1.1.3/lib/merb-core.rb:615:in `load_dependencies'
/home/rajendran/projects/myapp/Rakefile:23
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/gems/rake-0.8.7/bin/rake:31
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/bin/rake:23:in `load'
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/bin/rake:23
/home/rajendran/.rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:15

Without trace

rake db:migrate
(in /home/rajendran/projects/myapp)
Merb root at: /home/rajendran/projects/myapp
rake aborted!
undefined method `cache' for Gem:Module
/home/rajendran/projects/myapp/Rakefile:23

帮我解决这个问题..

最佳答案

解决方案:

  1. 我需要 ruby​​ 1.8.7(我不能升级,它的项目依赖)
  2. gem set 的问题,我将 gem -v 2.0 更改为 1.8.25 就这样

感谢您的支持

更新:

更新/降级 gemset

gem update --system 1.8.25

关于ruby-on-rails - 迁移错误 : undefined method `cache' for Gem:Module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20239867/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com