- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
当我查看 resque-web (localhost) 上的“workers”选项卡时出现运行时错误。其他一切正常。
编辑:发生此错误时,我还有一些(3 或 4 个)未知工作人员“不工作”。我认为他们应对错误负责,但我不明白他们是如何到达这里的。只有当我从上帝开始 worker 时才会发生
你能帮我解决这个问题吗?我做错了什么吗?
配置:Resque 1.8.5 作为 Snow Leopard 上 rails 2.3.8 应用程序中的 gemredis 1.0.7/rack 1.1/sinatra 1.0/vegas 0.1.7
回溯:
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in format_error_reply
*
551. when DOLLAR then format_bulk_reply(line)
552. when ASTERISK then format_multi_bulk_reply(line)
553. else raise ProtocolError.new(reply_type)
554. end
555. end
556.
557. def format_error_reply(line)
558. raise "-" + line.strip
559. end
560.
561. def format_status_reply(line)
562. line.strip
563. end
564.
565. def format_integer_reply(line)
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in format_reply
*
541.
542. def reconnect
543. disconnect && connect_to_server
544. end
545.
546. def format_reply(reply_type, line)
547. case reply_type
548. when MINUS then format_error_reply(line)
549. when PLUS then format_status_reply(line)
550. when COLON then format_integer_reply(line)
551. when DOLLAR then format_bulk_reply(line)
552. when ASTERISK then format_multi_bulk_reply(line)
553. else raise ProtocolError.new(reply_type)
554. end
555. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in read_reply
*
478. disconnect
479.
480. raise Errno::EAGAIN, "Timeout reading from the socket"
481. end
482.
483. raise Errno::ECONNRESET, "Connection lost" unless reply_type
484.
485. format_reply(reply_type, @sock.gets)
486. end
487.
488.
489. if "".respond_to?(:bytesize)
490. def get_size(string)
491. string.bytesize
492. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in process_command
*
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in map
*
446. end
447.
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in process_command
*
446. end
447.
448. return pipeline ? results : results[0]
449. end
450.
451. def process_command(command, argvv)
452. @sock.write(command)
453. argvv.map do |argv|
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in raw_call_command
*
435. @sock.write(command)
436. return true
437. end
438. # The normal command execution is reading and processing the reply.
439. results = maybe_lock do
440. begin
441. set_socket_timeout!(0) if requires_timeout_reset?(argvv[0][0].to_s)
442. process_command(command, argvv)
443. ensure
444. set_socket_timeout!(@timeout) if requires_timeout_reset?(argvv[0][0].to_s)
445. end
446. end
447.
448. return pipeline ? results : results[0]
449. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in synchronize
*
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
463. block.call
464. end
465. end
466.
467. def read_reply
468.
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in maybe_lock
*
454. processor = REPLY_PROCESSOR[argv[0].to_s]
455. processor ? processor.call(read_reply) : read_reply
456. end
457. end
458.
459. def maybe_lock(&block)
460. if @thread_safe
461. @mutex.synchronize(&block)
462. else
463. block.call
464. end
465. end
466.
467. def read_reply
468.
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in raw_call_command
*
432. end
433. # When in Pub/Sub mode we don't read replies synchronously.
434. if @pubsub
435. @sock.write(command)
436. return true
437. end
438. # The normal command execution is reading and processing the reply.
439. results = maybe_lock do
440. begin
441. set_socket_timeout!(0) if requires_timeout_reset?(argvv[0][0].to_s)
442. process_command(command, argvv)
443. ensure
444. set_socket_timeout!(@timeout) if requires_timeout_reset?(argvv[0][0].to_s)
445. end
446. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in call_command
*
336. # try to reconnect just one time, otherwise let the error araise.
337. def call_command(argv)
338. log(argv.inspect, :debug)
339.
340. connect_to_server unless connected?
341.
342. begin
343. raw_call_command(argv.dup)
344. rescue Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED
345. if reconnect
346. raw_call_command(argv.dup)
347. else
348. raise Errno::ECONNRESET
349. end
350. end
* /Library/Ruby/Gems/1.8/gems/redis-1.0.7/lib/redis/client.rb in method_missing
*
385. connect_to(@host, @port)
386. call_command([:auth, @password]) if @password
387. call_command([:select, @db]) if @db != 0
388. @sock
389. end
390.
391. def method_missing(*argv)
392. call_command(argv)
393. end
394.
395. def raw_call_command(argvp)
396. if argvp[0].is_a?(Array)
397. argvv = argvp
398. pipeline = true
399. else
* /Library/Ruby/Gems/1.8/gems/redis-namespace-0.4.4/lib/redis/namespace.rb in send
*
159. args = add_namespace(args)
160. args.push(last) if last
161. when :alternate
162. args = [ add_namespace(Hash[*args]) ]
163. end
164.
165. # Dispatch the command to Redis and store the result.
166. result = @redis.send(command, *args, &block)
167.
168. # Remove the namespace from results that are keys.
169. result = rem_namespace(result) if after == :all
170.
171. result
172. end
173.
* /Library/Ruby/Gems/1.8/gems/redis-namespace-0.4.4/lib/redis/namespace.rb in method_missing
*
159. args = add_namespace(args)
160. args.push(last) if last
161. when :alternate
162. args = [ add_namespace(Hash[*args]) ]
163. end
164.
165. # Dispatch the command to Redis and store the result.
166. result = @redis.send(command, *args, &block)
167.
168. # Remove the namespace from results that are keys.
169. result = rem_namespace(result) if after == :all
170.
171. result
172. end
173.
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/worker.rb in state
*
416. def idle?
417. state == :idle
418. end
419.
420. # Returns a symbol representing the current worker state,
421. # which can be either :working or :idle
422. def state
423. redis.exists("worker:#{self}") ? :working : :idle
424. end
425.
426. # Is this worker the same as another worker?
427. def ==(other)
428. to_s == other.to_s
429. end
430.
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in __tilt_a2112543c5200dbe0635da5124b47311
*
46. <tr>
47. <th> </th>
48. <th>Where</th>
49. <th>Queues</th>
50. <th>Processing</th>
51. </tr>
52. <% for worker in (workers = resque.workers.sort_by { |w| w.to_s }) %>
53. <tr class="<%=state = worker.state%>">
54. <td class='icon'><img src="<%=u state %>.png" alt="<%= state %>" title="<%= state %>"></td>
55.
56. <% host, pid, queues = worker.to_s.split(':') %>
57. <td class='where'><a href="<%=u "workers/#{worker}"%>"><%= host %>:<%= pid %></a></td>
58. <td class='queues'><%= queues.split(',').map { |q| '<a class="queue-tag" href="' + u("/queues/#{q}") + '">' + q + '</a>'}.join('') %></td>
59.
60. <td class='process'>
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in each
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server/views/workers.erb in __tilt_a2112543c5200dbe0635da5124b47311
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in send
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in evaluate
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/tilt.rb in render
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in render
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in erb
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server.rb in show
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/lib/resque/server.rb in GET /workers
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in catch
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in each
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in route!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in dispatch!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in instance_eval
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in catch
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in invoke
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call!
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in synchronize
* /Library/Ruby/Gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/content_length.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/chunked.rb in call
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb in process
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in process_client
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in each
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in process_client
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in initialize
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in new
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in initialize
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in new
* /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb in run
* /Volumes/Donnees/Users/**/.gem/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb in run
* /Library/Ruby/Gems/1.8/gems/vegas-0.1.7/lib/vegas/runner.rb in run!
* /Library/Ruby/Gems/1.8/gems/vegas-0.1.7/lib/vegas/runner.rb in start
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/bin/resque-web in new
* /Library/Ruby/Gems/1.8/gems/resque-1.8.5/bin/resque-web in nil
* /usr/bin/resque-web in load
最佳答案
我发现了问题:
在 god 配置文件中,我有(在 QUEUE 中逗号后有空格):
num_workers.times do |num|
God.watch do |w|
w.name = "resque-#{num}"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical, high, low", "RAILS_ENV"=>rails_env}
而不是(逗号后没有空格):
num_workers.times do |num|
God.watch do |w|
w.name = "resque-#{num}"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
现在可以了!!
关于ruby - 在/workers : wrong number of arguments for 'exists' command 处请求运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2905358/
我正在尝试安装一种用于 TCPDF 的字体。为此,我需要运行附带的命令行实用程序 ttf2ufm。 (包含在 TCPDF 中的 fonts/utils/ttf2ufm 中)但是当我运行它时,出现错误
我是 answering a question并假设 if [ $(command) ]; then ... 总是等同于 if command; then ... 但是,我得到了a couple of
我的package.json定义: ... "scripts": { "start": "node scripts/start.js", "build"
我知道默认的“CTRL+B”Windows 命令可用于显示所有嵌套文件。 是否有显示所有嵌套文件夹的快捷方式? 最佳答案 我怀疑 Total Commander 中是否存在此功能。内置tree实用性对
任何人都可以告诉我,是否有任何可以检测当前运营商名称的AT命令? 我用过AT+COPS? 它返回给我运算符(operator)的数字代码:0,2,40410 然后我使用命令 AT+WOPN = 0,4
我需要将网站托管到 google firebase 托管。 我几乎到处都看过,但钢有问题。 我已安装 npm install --global firebase 还有 npm install -g f
我想要这样的东西 如果(command_not_exists)退出 谁能告诉我如何在 cshell 脚本中实现此功能? 最佳答案 我的问题是使用 where 命令解决的(我尝试使用 which 命令)
通过使用 + 的参数调用它,我可以使 vim 将光标定位在文件的最后一行。 : vi + myfile # "+" = go to last line of file 我怎样才能做到
我想要这样的东西 如果(command_not_exists)退出 谁能告诉我如何在 cshell 脚本中实现此功能? 最佳答案 我的问题是使用 where 命令解决的(我尝试使用 which 命令)
在 cobra 中,我创建了一个命令命令: myapp zip -directory "xzy" -output="zipname" myapp upload -filename="abc" 我想制作
我应用了所有可能的答案,但仍然是同样的问题。 也试过 $this->db->reconnect(); 我的查询没有问题 我的代码: public function GetdistributorsDet
有什么区别: eval echo lala 和: command="echo lala" $command 它们似乎都具有相同的效果,但我可能遗漏了一些东西。此外,如果它们确实具有相同的效果,那么ev
要将命令的输出存储为 sh/ksh/bash 中的变量,您可以执行任一操作 var=$(command) 或 var=`command` 这两种方法有什么区别? 最佳答案 反引号/标记已被弃用,取而代
我想让我的用户根据他的选择以 sudo 和普通用户身份运行。他可以使用 sudo 或普通用户,但如果不使用 sudo,我必须禁用某些功能来消除错误。那么我怎么知道该用户是否给了我 sudo 执行权限?
这个问题已经有答案了: Command substitution: backticks or dollar sign / paren enclosed? [duplicate] (3 个回答) 已关闭
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Command substitution: backticks or dollar sign / paren enc
要将命令的输出存储为 sh/ksh/bash 中的变量,您可以执行任一操作 var=$(command) 或 var=`command` 这两种方法有什么区别? 最佳答案 反引号/标记已被弃用,取而代
Linux 101 Hacks 这本书的第 38 页建议: cat url-list.txt | xargs wget –c 我通常这样做: for i in `cat url-list.txt`
问题是当我为我的项目编写 Makefile 时,当我需要检测当前分支名称时,在 make 规则中我这样做了: check_branch: if [ "$(git rev-parse --abb
默认情况下,控制台命令文件夹位于:MyProject\MyBundle\Command并且一切都按预期工作,但是如果我将文件夹移动到另一个目录中,例如:MyProject\MyBundle\MyFol
我是一名优秀的程序员,十分优秀!