Getting strange error while performing rake task. Automated creating users for testing. It''s creating users till number 999, getting error while creating user 1000. Rake Task : desc "Generate test users" task :generate_test_users => :environment do for i in (1..5000) User.create(:username=>"user#{i}", :email=>"user#{i}@user.com", :password=>"123456", :confirm_password=>"123456", :state=>"Active", :first_name=>"user_first#{i}", :last_name=>"user_last#{i}", :activation_state=>"Active", :is_admin=>false, :product_source=>"Both") puts "user#{i}" end end Please suggest. Attachments: http://www.ruby-forum.com/attachment/6889/Screenshot.png -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 January 2012 12:52, Dharmdip Rathod <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Getting strange error while performing rake task. > > Automated creating users for testing. > > It''s creating users till number 999, getting error while creating user > 1000. > > Rake Task : > > desc "Generate test users" > task :generate_test_users => :environment do > for i in (1..5000) > User.create(:username=>"user#{i}", :email=>"user#{i}@user.com", > :password=>"123456", :confirm_password=>"123456", :state=>"Active", > :first_name=>"user_first#{i}", :last_name=>"user_last#{i}", > :activation_state=>"Active", :is_admin=>false, :product_source=>"Both") > puts "user#{i}" > end > > end > > Please suggest. > > Attachments: > http://www.ruby-forum.com/attachment/6889/Screenshot.pngIt appears to be attempting to send an email for each user created, did you intend that? The problem is something to do with that. Which version of ruby and which version of rails are you using? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 7, 7:52 am, Dharmdip Rathod <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Getting strange error while performing rake task. > > Automated creating users for testing. > > It''s creating users till number 999, getting error while creating user > 1000. > > Rake Task : > > desc "Generate test users" > task :generate_test_users => :environment do > for i in (1..5000) > User.create(:username=>"user#{i}", :email=>"user#...@user.com", > :password=>"123456", :confirm_password=>"123456", :state=>"Active", > :first_name=>"user_first#{i}", :last_name=>"user_last#{i}", > :activation_state=>"Active", :is_admin=>false, :product_source=>"Both") > puts "user#{i}" > end > > end > > Please suggest. > > Attachments:http://www.ruby-forum.com/attachment/6889/Screenshot.pngIt''s blowing up in an SMTP transfer - my guess is that whatever email server you''ve set up for ActionMailer is rate-limiting at 1000 emails. If you''re just trying to set up some dummy user accounts, you may want to set ActionMailer::Base.delivery_method = :test at the beginning of the task. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote in post #1039845:> On 7 January 2012 12:52, Dharmdip Rathod <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> task :generate_test_users => :environment do >> Please suggest. >> >> Attachments: >> http://www.ruby-forum.com/attachment/6889/Screenshot.png > > It appears to be attempting to send an email for each user created, > did you intend that? The problem is something to do with that. > > Which version of ruby and which version of rails are you using? > > ColinThanks for reply Colin. Ruby 1.9.2 and Rails 3.1.0 . -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Matt Jones wrote in post #1039979:> On Jan 7, 7:52am, Dharmdip Rathod <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> task :generate_test_users => :environment do >> Please suggest. >> >> Attachments:http://www.ruby-forum.com/attachment/6889/Screenshot.png > > It''s blowing up in an SMTP transfer - my guess is that whatever email > server you''ve set up for ActionMailer is rate-limiting at 1000 emails. > > If you''re just trying to set up some dummy user accounts, you may want > to set ActionMailer::Base.delivery_method = :test at the beginning of > the task. > > --Matt JonesHey Matt, You are correct.I had just set in rake task and things get working. Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.