Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 使用Deviate async发送电子邮件不起作用(Rails/Sidekiq)_Ruby On Rails_Devise_Redis_Sidekiq_Devise Async - Fatal编程技术网

Ruby on rails 使用Deviate async发送电子邮件不起作用(Rails/Sidekiq)

Ruby on rails 使用Deviate async发送电子邮件不起作用(Rails/Sidekiq),ruby-on-rails,devise,redis,sidekiq,devise-async,Ruby On Rails,Devise,Redis,Sidekiq,Devise Async,我的Rails应用程序中有sidekiq(2.15.2)、devise(3.2.0)和devise async(0.9.0) 我正试图让设计异步来接管发送电子邮件的工作。但是没有运气。我遵循了这样的原则: 将:async添加到用户模型: # models/user.rb class User include Mongoid::Document devise :database_authenticatable, :registerable, :recoverable, :remembera

我的Rails应用程序中有
sidekiq(2.15.2)
devise(3.2.0)
devise async(0.9.0)

我正试图让
设计异步
来接管发送电子邮件的工作。但是没有运气。我遵循了这样的原则:

:async
添加到
用户
模型:

# models/user.rb
class User
  include Mongoid::Document
  devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :async
end
创建初始值设定项:

# config/initializers/devise_async.rb
Devise::Async.backend = :sidekiq
我没有在我的邮件中进行任何自定义修改

# config/initializers/devise_async.rb
Devise.setup do |config|
  config.mailer_sender = "my@email.com"
  # config.mailer = "Devise::Mailer"
end
以下是创建新帐户时控制台中显示的内容:

Started POST "/da/users" for 127.0.0.1 at 2014-05-29 14:42:07 +0200
Processing by RegistrationsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"wyIIRqVoYrXqbX/U+3PGyrYI/MIxcH1YErUQ7JWcfUs=", "user"=>{"company"=>"Some Company Ltd.", "email"=>"some@email.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Opret", "locale"=>"da"}
  MOPED: 127.0.0.1:27017 QUERY        database=mydb_development collection=users selector={"email"=>"some@email.com"} flags=[] limit=-1 skip=0 batch_size=nil fields={:_id=>1} runtime: 0.9300ms
  MOPED: 127.0.0.1:27017 QUERY        database=mydb_development collection=users selector={"$query"=>{"confirmation_token"=>"5bc925b83260b498dfc26e202c1403c39638527b62c85fec7e97c9f59d1f55d8"}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.8670ms
  MOPED: 127.0.0.1:27017 INSERT       database=mydb_development collection=users documents=[{"_id"=>BSON::ObjectId('53872b204368720748000000'), "email"=>"some@email.com", "encrypted_password"=>"$2a$10$6WQO8zK2Sl/HCPPYHIdKceKpaY9gH.LJZlRM8PA.6i2rePmI8C1Ii", "sign_in_count"=>0, "company"=>"Some Company Ltd", "confirmation_token"=>"5bc925b83260b498dfc26e202c1403c39638527b62c85fec7e97c9f59d1f55d8", "confirmation_sent_at"=>2014-05-29 12:42:08 UTC, "locale"=>"da", "timezone"=>"Europe/Copenhagen"}] flags=[]
                     COMMAND      database=mydb_development command={:getlasterror=>1, :w=>1} runtime: 1.0460ms
2014-05-29T12:42:08Z 1864 TID-oxcjnftnc INFO: Sidekiq client using redis://localhost:6379/0 with options {}
Redirected to http://localhost:3000/da/users/confirmation/new
Completed 302 Found in 1469ms
不过,我的Sidekiq日志没有显示任何内容


有什么想法吗?

Set
designe::Async.queue=:default
Set
designe::Async.queue=:default
好的,我将调用这个,只是因为它解决了我的问题。谢谢我的新问题是Deviate async忽略了区域设置,但我会在新问题中发布它,除非我自己找到解决方案。好的,我将称之为这个,只是因为它解决了我的问题。谢谢我的新问题是designe async忽略了区域设置,但除非我自己找到解决方案,否则我将在新问题中发布它。