1

VPS で Sidekiq を実行するのに問題があります。ローカルではすべて正常に動作しますが、デプロイすると、ユニコーン ログに次のエラーが記録されます。

E, [2012-09-18T21:41:19.670672 #1308] ERROR -- : uninitialized constant MailchimpWorker::Sidekiq (NameError)
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
/home/deployer/production/releases/20120919013128/app/workers/mailchimp_worker.rb:3:in `<class:MailchimpWorker>'
/home/deployer/production/releases/20120919013128/app/workers/mailchimp_worker.rb:1:in `<top (required)>'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/deployer/production/releases/20120919013128/config/environment.rb:5:in `<top (required)>'
config.ru:4:in `require'
config.ru:4:in `block in <main>'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
/home/deployer/production/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'

私のワーカーファイルの内容は次のとおりです。

class MailchimpWorker

  include Sidekiq::Worker

  LIST_ID = '844161948b'

  def perform(email)
    Gibbon.listSubscribe id: LIST_ID, email_address: email
  end

end

私が間違っていることについてのアイデアはありますか?

4

3 に答える 3

0

バンドル内でユニコーンを実行していますか?

bundle exec unicorn
于 2012-09-28T10:53:59.077 に答える
0

開発環境では動作するが本番環境では動作しない場合は、バンドラーが本番環境で gem をロードしていないようです。どのグループが Gemfile にリストされているか、またどのようにデプロイするかによって異なります (どのようにバンドラーが運用環境に gem をインストールしますか?)。

では、Gemfile と、展開スクリプトの関連ビットを投稿できますか?

また、bundle exec を使用して sidekiq プロシージャが開始されていることを再確認します。

于 2012-09-25T15:57:20.133 に答える
0

これはgem 'sidekiq'Gemfile にないようです。

于 2012-09-21T23:13:56.020 に答える