0

resqueをインストールするための構成ガイドラインに従っています。(LoadError)が発生しました。私はRVM1.9.2-p180、rails 3.0.6、およびPOWを使用しています。これはおそらく、ロードパスが完全に間違っているという問題です。だからここにいくつかの追加情報があります:

 master ~/projects/chaggregator $ which rails
/Users/boris/.rvm/gems/ruby-1.9.2-p180/bin/rails
 master ~/projects/chaggregator $ which ruby
/Users/boris/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
 master ~/projects/chaggregator $ whereis ruby
/usr/bin/ruby
 master ~/projects/chaggregator $ whereis rails
/usr/bin/rails

config / resque.yml

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

initializers / resque.rb:

rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'

resque_config = YAML.load_file(rails_root + '/config/resque.yml')
Resque.redis = resque_config[rails_env] 

ターミナル:

~ $ cd projects/MyApp/
 master ~/projects/MyApp $ RAILS_ENV=production resque-web rails_root/config/initializers/resque.rb
/Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/resque-1.16.1/bin/resque-web:16:in `load': no such file to load -- rails_root/config/initializers/resque.rb (LoadError)
    from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/resque-1.16.1/bin/resque-web:16:in `block in <top (required)>'
    from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:54:in `call'
    from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/vegas-0.1.8/lib/vegas/runner.rb:54: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-server(localhost: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.
4

1 に答える 1

2

コマンドラインでrails_rootを使用することはできません。

 master ~/projects/MyApp $ RAILS_ENV=production resque-web rails_root/config/initializers/resque.rb

試す:

RAILS_ENV=production resque-web config/initializers/resque.rb
于 2011-05-20T18:03:01.747 に答える