Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- memcache at startup #434

Closed
loicginoux opened this issue Sep 30, 2019 · 1 comment
Closed

cannot load such file -- memcache at startup #434

loicginoux opened this issue Sep 30, 2019 · 1 comment

Comments

@loicginoux
Copy link

loicginoux commented Sep 30, 2019

Hi,
I have the following issue when starting my rails app. it does not seem like memcache is required but I still have the error.
I use the starter configuration from the doc (https://github.com/kickstarter/rack-attack/blob/master/docs/example_configuration.md)
I saw this issue that seem similar #163 but I didn't manage to pull a solution from it.
Is it my configuration that's bad or a problem with the gem ?
It works by installing the memcache gem in my gemfile, but if I want use redis, I should not need to add this dependency.

Traceback (most recent call last):
  42: from script/rails:6:in `<main>'
  41: from script/rails:6:in `require'
  40: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/commands.rb:40:in `<top (required)>'
  39: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/application.rb:103:in `require_environment!'
  38: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
  37: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
  36: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
  35: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
  34: from /Users/myself/projects/clients/gemsetA/gemsetA-main/config/environment.rb:24:in `<top (required)>'
  33: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
  32: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/application.rb:136:in `initialize!'
  31: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `run_initializers'
  30: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `each'
  29: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/initializable.rb:55:in `block in run_initializers'
  28: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `run'
  27: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `instance_exec'
  26: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `block in <class:Engine>'
  25: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `each'
  24: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/railties-3.2.22.5/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
  23: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
  22: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
  21: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `block in load'
  20: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
  19: from /Users/myself/projects/clients/gemsetA/gemsetA-main/config/initializers/rack_attack.rb:1:in `<top (required)>'
  18: from /Users/myself/projects/clients/gemsetA/gemsetA-main/config/initializers/rack_attack.rb:13:in `<class:Attack>'
  17: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack.rb:123:in `cache'
  16: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack.rb:123:in `new'
  15: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/cache.rb:8:in `initialize'
  14: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/cache.rb:14:in `store='
  13: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/store_proxy.rb:8:in `build'
  12: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/store_proxy.rb:8:in `find'
  11: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/store_proxy.rb:8:in `each'
  10: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/store_proxy.rb:8:in `block in build'
   9: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/rack-attack-5.4.2/lib/rack/attack/store_proxy/mem_cache_store_proxy.rb:10:in `handle?'
   8: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
   7: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
   6: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
   5: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
   4: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/cache/mem_cache_store.rb:2:in `<top (required)>'
   3: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
   2: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
   1: from /Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
/Users/myself/.rvm/gems/ruby-2.6.4@gemsetA/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- memcache (LoadError)
@grzuy
Copy link
Collaborator

grzuy commented Sep 30, 2019

Hi @loicginoux,

Rails 3.2 compatibility is no longer "officially supported" since rack-attack 5.0+ (f6762df). That doesn't mean it won't work, but it means we don't test new changes against it, so we can't guarantee it will o will not work.

That said, from looking at the backtrace it seems that specific exception will probably go away if you use rack-attack 6.0+ instead of 5.4.2 because of #381. You may get other errors, as I said before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants