Ruby on rails Rspec在@rb_sysopen抛出太多打开的文件,尽管ulimit-n显示98304

Ruby on rails Rspec在@rb_sysopen抛出太多打开的文件,尽管ulimit-n显示98304,ruby-on-rails,ruby,macos,Ruby On Rails,Ruby,Macos,当我运行rspec时,我得到:“太多打开的文件@rb_sysopen” 我试着增加ulimits,这是Mac为-u提供的最大值,对于-n来说这是一个相当大的数字,应该足够了吧 Mac-Pro.local ➜ timeline git:(master) ✗ ulimit -u 5568 Mac-Pro.local ➜ timeline git:(master) ✗ ulimit -n 98304 但是,当我运行rspec时,我看到: Mac-Pro.local ➜ timeline git

当我运行rspec时,我得到:“太多打开的文件@rb_sysopen”

我试着增加ulimits,这是Mac为-u提供的最大值,对于-n来说这是一个相当大的数字,应该足够了吧

Mac-Pro.local ➜  timeline git:(master) ✗ ulimit -u
5568
Mac-Pro.local ➜  timeline git:(master) ✗ ulimit -n
98304
但是,当我运行rspec时,我看到:

Mac-Pro.local ➜  timeline git:(master) ✗ bundle exec rspec
Run options: include {:focus=>true}

Randomized with seed 42688

Events
  GET /events
Capybara starting Puma...
* Version 4.3.1 , codename: Mysterious Traveller
* Min threads: 0, max threads: 4
* Listening on tcp://127.0.0.1:9887
2020-01-25 14:12:20 +0000: Rack app error handling request { GET /login }
#<ActionView::Template::Error: Too many open files @ rb_sysopen - /Users/hackeron/Development/Tether/timeline/tmp/cache/assets/sprockets/v4.0.0/8u/8uWBpzJCocO4CDXelfFLLPyiTEylUJcg-Cn9YTJQ52I.cache>
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `initialize'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `open'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `safe_open'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:59:in `get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:223:in `get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:122:in `get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:324:in `fetch_asset_from_dependency_cache'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:32:in `block in call'
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in `each_key'
/usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in `each'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:31:in `call'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:81:in `find_asset'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:88:in `find_all_linked_assets'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'

Screenshot Taken: /Users/hackeron/Development/Tether/timeline/tmp/capybara/test-failure-events_spec.rb-112.png
    does not display for integrators with support_access disabled (FAILED - 1)

Failures:

  1) Events GET /events does not display for integrators with support_access disabled
    Failure/Error: File.open(path, 'rb', &block)

    ActionView::Template::Error:
      Too many open files @ rb_sysopen - /Users/hackeron/Development/Tether/timeline/tmp/cache/assets/sprockets/v4.0.0/8u/8uWBpzJCocO4CDXelfFLLPyiTEylUJcg-Cn9YTJQ52I.cache
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `initialize'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `open'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `safe_open'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:59:in `get'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:223:in `get'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:122:in `get'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:324:in `fetch_asset_from_dependency_cache'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:32:in `block in call'
    # /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in `each_key'
    # /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in `each'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:31:in `call'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:81:in `find_asset'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:88:in `find_all_linked_assets'
    # /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in `block in realize'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
    # /usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
    # ------------------
    # --- Caused by: ---
    # Errno::EMFILE:
    #   Too many open files @ rb_sysopen - /Users/hackeron/Development/Tether/timeline/tmp/cache/assets/sprockets/v4.0.0/8u/8uWBpzJCocO4CDXelfFLLPyiTEylUJcg-Cn9YTJQ52I.cache
    #   /usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:in `initialize'

Finished in 6.82 seconds (files took 11.39 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/integration/events_spec.rb:112 # Events GET /events does not display for integrators with support_access disabled

Randomized with seed 42688

Coverage report generated for RSpec to /Users/hackeron/Development/Tether/timeline/coverage. 3000 / 13882 LOC (21.61%) covered.
SimpleCov failed with exit 1%                                                                                                                                                                                                                                                                                                                                               Mac-Pro.local ➜  timeline git:(master) ✗
Mac-Pro.local➜  时间轴git:(主)✗ bundle exec rspec
运行选项:包括{:focus=>true}
随机化种子42688
事件
获取/获取事件
水豚启动美洲狮。。。
*版本4.3.1,代号:神秘旅行者
*最小线程数:0,最大线程数:4
*倾听tcp://127.0.0.1:9887
2020-01-25 14:12:20+0000:机架应用程序错误处理请求{GET/login}
#
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“初始化”中
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“打开”中
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“安全打开”中
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:59:in'get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:223:in'get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:122:in'get'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:324:in'fetch_asset_from_dependency_cache'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in'load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_-environment.rb:44:in'load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:32:in'block-in-call'
/usr/local/ceral/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in'each_key'
/usr/local/ceral/ruby/2.6.5/lib/ruby/2.6.0/set.rb:338:in'each'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:31:in'call'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in'call_processor'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `块入调用_处理器'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:在“反向”中
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in'call_processors'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in'load_from_unload'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in'block in load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:“从依赖项缓存中获取资产”
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in'load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cached_-environment.rb:44:in'load'
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:81:在“查找资产”中
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:88:“查找所有链接资产”
/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:125:在“查找中的块(2级)”中
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:24:in'block in execute'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex\u lockable\u object.rb:41:在“同步中的块”中
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex\u lockable\u object.rb:41:in'synchronization'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/synchronization/mutex\u lockable\u object.rb:41:in'synchronization'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/safe_task_executor.rb:19:in'execute'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/promise.rb:563:in'block in realize'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:348:in'run\u task'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:337:create\u worker中的“块(3层)”中
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:320:in'loop'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:320:create\u worker中的“块(2层)”中
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:319:in'catch'
/usr/local/lib/ruby/gems/2.6.0/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby\u thread\u pool\u executor.rb:319:in'block in create\u worker'
截图:/Users/hackeron/Development/Tether/timeline/tmp/capybara/test-failure-events_spec.rb-112.png
不显示支持访问被禁用的集成商(失败-1)
失败:
1) 对于禁用支持访问的集成商,不显示事件GET/Events
失败/错误:File.open(路径'rb',&block)
ActionView::模板::错误:
打开的文件太多@rb_sysopen-/Users/hackeron/Development/Tether/timeline/tmp/cache/assets/sprockets/v4.0.0/8u/8uwbpzjcoc4cdxlpflpyiteylujcg-Cn9YTJQ52I.cache
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“初始化”中
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“打开”中
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:178:在“安全打开”中
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache/file_store.rb:59:in'get'
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:223:in'get'
#/usr/local/lib/ruby/gems/2.6.0/gems/sprockets-4.0.0/lib/sprockets/cache.rb:122:in'get'
#/usr/local/lib/ruby/gems/2.6.0/gems/sproc