2011-05-20 13 views
7

resque'u yüklemek için yapılandırma yönergelerini takip ediyorum. Bir (OpenURI :: HTTPError) ile tanıştım. RVM 1.9.2-p180 kullanıyorum, 3.0.6 ve raylar POW .'resque-web '500 Sunucu Hatası ile başlamak için başarısız. Ne halt oluyor burada? RAILS_ENV=development resque-web config/initializers/resque.rb resque-web, bir 500 Sunucu Hatası ile başlatılamadı

config/resque.yml: $ VVERBOSE=1 QUEUE=file_serve rake environment resque:work

  • deneyin ile $ redis-server
  • başlatın bir işçi ile

    1. Başlat Redis ile Resque-Web başlatmak için:

      sorunu çoğaltmak için

      development: localhost:6379 
      test: localhost:6379 
      staging: localhost:6379 
      fi: localhost:6379 
      

      ilklendiriciler/resque.rb:

      rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' 
      rails_env = ENV['RAILS_ENV'] || 'development' 
      
      require 'resque' 
      # require 'yaml' 
      
      unless defined?($redis) 
          $redis = Redis.new($redis = Redis.new(:host => 'localhost', :port => 6379)) 
      end 
      
      Resque.redis = $redis 
      

      Terminali:

       master ~/projects/MyApp $ RAILS_ENV=development resque-web config/initializers/resque.rb 
      [2011-05-20 11:42:48 -0700] Starting 'resque-web'... 
      /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:346:in `open_http': 500 Internal Server Error (OpenURI::HTTPError) 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:769:in `buffer_open' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:203:in `block in open_loop' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:201:in `catch' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:201:in `open_loop' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:671:in `open' 
          from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/open-uri.rb:33:in `open' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:142:in `port_open?' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:159:in `check_for_running' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:104:in `start' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:77:in `initialize' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/resque-1.16.1/bin/resque-web:13:in `new' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/resque-1.16.1/bin/resque-web:13:in `<top (required)>' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/bin/resque-web:19:in `load' 
          from /Users/boris/.rvm/gems/ruby-1.9.2-p180/bin/resque-web:19:in `<main>' 
      

      Redis-sunucu (ı localhost vurduğunda Fazladan müşteri bağlayan ediyorum: 6379.

      [33324] 20 May 11:02:08 - 1 clients connected (0 slaves), 932400 bytes in use 
      [33324] 20 May 11:02:12 - Accepted 127.0.0.1:53028 
      [33324] 20 May 11:02:13 - DB 0: 7 keys (0 volatile) in 8 slots HT. 
      [33324] 20 May 11:02:13 - 2 clients connected (0 slaves), 942976 bytes in use 
      [33324] 20 May 11:02:18 - DB 0: 7 keys (0 volatile) in 8 slots HT. 
      

      başlatıcıları/redis.rb

      $redis = Redis.new(:host => 'localhost', :port => 6379) 
      

      Terminali: ($ kanıtı Redis)

      > $redis 
      #<Redis client v2.2.0 connected to redis://localhost:6379/0 (Redis v2.2.5)> 
      ruby-1.9.2-p180 :003 > $redis.set('pepper', 'bacon') #=> "OK" 
      ruby-1.9.2-p180 :004 > $redis.get('pepper') #=> "bacon" 
      
  • +0

    biraz aynı sorun, bunu çözdünüz mü? – Rubytastic

    +2

    Aynı hata mesajını (500 dahili sunucu hatası) aldım ancak farklı bir nedenden ötürü: zaten var olan işlemi iptal etmek için 5678 varsayılan portunda çalışan bir resque-web örneği var. Resque-web -K' Bu hata mesajını benim için çözdüm. – gempesaw

    cevap

    3

    Şu ana kadar: Sadece yapmayı deneyin

    $redis = Redis.new($redis = Redis.new(:host => 'localhost', :port => 6379)) 
    

    :

    İlgili konular