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.
On 7 January 2012 12:52, Dharmdip R. [email protected] 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?
Colin
On Jan 7, 7:52am, Dharmdip R. [email protected] 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 J.
Matt J. wrote in post #1039979:
On Jan 7, 7:52am, Dharmdip R. [email protected] 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 J.
Hey Matt,
You are correct.
Thanks.
Colin L. wrote in post #1039845:
On 7 January 2012 12:52, Dharmdip R. [email protected] 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?
Colin
Thanks for reply Colin.
Ruby 1.9.2 and Rails 3.1.0 .