Question

We cannot clear the cache on Heroku despite trying Rails.cache.clear and rake tmp:clear.

Help?

Console output and errors:

irb(main):001:0> rake tmp:clear
NameError: undefined local variable or method `clear' for main:Object
    from (irb):1
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'


irb(main):002:0> Rails.cache.clear
Errno::ENOENT: No such file or directory - /app/tmp/cache/
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/file_store.rb:26:in `open'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/file_store.rb:26:in `entries'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/file_store.rb:26:in `clear'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:88:in `clear'
    from (irb):2
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
irb(main):003:0> exit


wc:~ c$ heroku run --app p-g rails runner -e production Rails.cache.clear
Running `rails runner -e production Rails.cache.clear` attached to terminal... up, run.6955
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : NEW_RELIC_LOG does not have a corresponding configuration setting (log does not exist).
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Run `rake newrelic:config:docs` or visit https://newrelic.com/docs/ruby/ruby-agent-configuration to see a list of available configuration settings.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Starting the New Relic agent in "production" environment.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Reading configuration from 
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] ERROR : Unable to read configuration file : Is a directory - /app
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Enabling the Request Sampler.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Environment: production
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : No known dispatcher detected.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Application: production
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] WARN : Refusing to re-register DependencyDetection block with name 'typhoeus'
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] WARN : Refusing to re-register DependencyDetection block with name 'curb'
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Mongo instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing deferred Rack instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Unicorn instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Detected Unicorn, please see additional documentation: https://newrelic.com/docs/troubleshooting/im-using-unicorn-and-i-dont-see-any-data
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Net instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Rails 3 Controller instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Rails 3.1/3.2 view instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Installing Rails3 Error instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Finished instrumentation
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Starting the New Relic agent in "production" environment.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml.
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Reading configuration from 
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] ERROR : Unable to read configuration file : Is a directory - /app
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Reporting to: https://rpm.newrelic.com/accounts/401477/applications/2403960
** [NewRelic][12/31/13 08:30:23 +0000 868d7dfd-65ca-43c7-b727-eb36055b9d2d (2)] INFO : Starting Agent shutdown
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/runner.rb:53:in `eval': No such file or directory - /app/tmp/cache/ (Errno::ENOENT)
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/file_store.rb:26:in `entries'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/file_store.rb:26:in `clear'
    from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:88:in `clear'
    from (eval):1:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/runner.rb:53:in `eval'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/runner.rb:53:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:64:in `require'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:64:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
Était-ce utile?

La solution

You have to run

heroku run rake tmp:create

first.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top