迁移错误:Gem:Module的未定义方法`cache'

时间:2013-11-27 10:28:05

标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.2 rubygems

在使用rails app进行迁移时出现此错误

  

Gem:Module

的未定义方法`cache'

使用

  

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
  

无痕迹

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

帮我解决这个问题..

4 个答案:

答案 0 :(得分:6)

<强>解决方案:

  1. 我需要ruby 1.8.7(我无法升级,依赖于项目)
  2. gem set 的问题,我将gem -v 2.0更改为1.8.25,这一切都是
  3. 感谢您的支持

    更新

    更新/降级gemset

    gem update --system 1.8.25
    

答案 1 :(得分:2)

Cannot delete web service "azuremlweb" because one or more additional endpoints were created for it. These endpoints must be deleted before you can delete the web service.

为我工作。

答案 2 :(得分:1)

我在Ruby 1.8.7和rails 2.0.2上遇到了类似的问题,所以我拿了your advice并降级了rubygems。这是告诉Ruby Version Manager执行此操作的命令:

rvm install --force rubygems 1.3.7

我想它并不想降级,所以你需要使用--force选项。

答案 3 :(得分:0)

您可能正在使用非常旧的RubyGems版本。我鼓励你upgrade RubyGems

您还应该停止使用Ruby 1.8.7。它已不再维护。升级到Ruby 1.9.3或更高版本。