2012-05-03 33 views
1

由於某種原因,我隨時用Ruby 1.8.7運行Rails 3.0.3應用程序。它運行良好,我沒有在任何地方設置任何cache_store設置。現在,只要我嘗試運行rake任務或rails命令我得到這個:無法找到memory_store的緩存存儲適配器

$:rails console production 
/home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/cache.rb:65:in `lookup_store': Could not find cache store adapter for memory_store (no such file to load -- active_support/cache/memory_store) (RuntimeError) 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/bootstrap.rb:48 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/bootstrap.rb:48 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' 
    from /home/marc_m3pt0/m3pt0.com/config/environment.rb:5 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /home/marc_m3pt0/.gems/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:103:in `require_environment!' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:22 
    from script/rails:6:in `require' 
    from script/rails:6 

什麼可能會錯過我的任何想法?

非常感謝。我的客戶網站現在正在關閉,所以任何幫助很快將不勝感激。

UPDATE

當我運行rake任務,我得到這個:

Could not find cache store adapter for memory_store (no such file to load -- active_support/cache/memory_store) 
+0

當你運行'bundle exec rails console production'時,你會看到什麼不同嗎? –

+0

我得到同樣的東西。 – Marc

回答

1

最近,我看到這個錯誤時,在共享主機移動應用到新的服務器。我最終吹走了應用程序的包並重新安裝它,它似乎工作。

我使用Capistrano進行部署,所以如果您使用其他內容,YMMV。如果您的應用程序根目錄是這樣的:

/home/jeff/myapp/ 

與以下子目錄:

/home/jeff/myapp/current 
/home/jeff/myapp/releases 
/home/jeff/myapp/shared 

寶石包是在這裏:

/home/jeff/myapp/shared/bundle 

然後我做:

rm -rf /home/jeff/myapp/shared/bundle 

然後

cd /home/jeff/myapp 
bundle install 

一旦我這樣做,它似乎爲我工作。

+0

我沒有任何這些子目錄。所以我不確定該怎麼做。 – Marc

+0

該解決方案適用於我。 –