8

今朝、次のエラーが発生しました。

  14) Deal on creation sets frozen to false or nil
     Failure/Error: Unable to find matching line from backtrace
     Errno::EMFILE:
       Too many open files - identify -format %wx%h '/var/folders/BJ/BJcTANEBFxWcan28U2YEKE+++TI/-Tmp-/stream20120229-36866-4l1sa8.gif[0]'
     # ./spec/support/blueprints.rb:29:in `block in <top (required)>'

スペックは(スポークでも)とても遅いので役に立たない。モデルで 20 の例を実行するには 9 分かかります。blueprint.rb の 29 行目は、次のブロックの間にあります。

Company.blueprint do
  name { "Office Tronic#{rand(10 ** 10)}" }
  website { 'officetronic.com' }
  subdomain {"officetronic#{rand(10 ** 10)}"}
  facebook { 'officetronic' }
  twitter { 'officetronic' }
  description { 'We are a company dealing with electronics and office supply' }
  address_line1 {'34 John Street'}
  address_line2 {''}
  post_code { 'EC2 3RR' }
  phone { '01 343243434' }
  city { 'London' }
  your_name { 'john Doe' }
  font_colour {'000000'}
  logo_file_name { 'mylogo.png' }  
  logo_content_type { "application/png" }
  logo_file_size { 100 }
end

Deal.blueprint do
  company {Company.make!}
  title { '50% off for web sites dev' }
  description { '50% of discount...' }
  quantity { 1 }
  min_quantity { 0 }
  start_time { Chronic.parse('one month') }
  end_time { Chronic.parse('two months') }
  price { 1500 } # in cents
  shipping_cost{ 100 } # in cents
  published { true }
  small_print { 'Some text' }
  show_map { true }
  post_code { 'E1 6BJ' }
  rrp {15}
end
4

1 に答える 1

15

開いているファイルが多すぎるのは OS エラーであり、OS がファイル ハンドルを使い果たしたことを意味します。Linux では通常、同時に開くことができるファイル数に厳しい制限があり、その制限に達しています。

制限を一時的に増やすには、ulimit -n 8192最初に実行してから spec を実行します。

制限を永続的に引き上げるには、次の手順に従いnginx、spec の実行に使用しているユーザー アカウントの名前に置き換えます。

于 2013-05-26T13:57:58.893 に答える