Raj Adroit Raj Adroit - 6 months ago 9
Ruby Question

migrate error: undefined method `cache' for Gem:Module

while migrating by rails app am getting this error


undefined method `cache' for Gem:Module


Am using


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


Help me to solve this problem..

Answer

Solution:

  1. I need ruby 1.8.7 ( i can't upgrade, its project dependent)
  2. problem at gem set, i changed gem -v 2.0 to 1.8.25 that's all

Thank you for your support

Update:

update/downgrade gemset

gem update --system 1.8.25