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@googlegroups.com.
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.

Search Discussions

  • Colin Law at Jan 7, 2012 at 1:20 pm

    On 7 January 2012 12:52, Dharmdip Rathod 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.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

    --
    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@googlegroups.com.
    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.
  • Dharmdip Rathod at Jan 9, 2012 at 2:16 pm

    Colin Law wrote in post #1039845:
    On 7 January 2012 12:52, Dharmdip Rathod 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 .

    --
    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@googlegroups.com.
    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.
  • Matt Jones at Jan 8, 2012 at 2:11 pm

    On Jan 7, 7:52 am, Dharmdip Rathod 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.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 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@googlegroups.com.
    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.
  • Dharmdip Rathod at Jan 9, 2012 at 2:17 pm

    Matt Jones wrote in post #1039979:
    On Jan 7, 7:52am, Dharmdip Rathod 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 Jones
    Hey 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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 7, '12 at 12:53p
activeJan 9, '12 at 2:17p
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase