You can parse a CSV file in Ruby, iterate through all the records and create the users with a temporary password.
You can read a csv file with ruby's CSV class:
CSV.open('my_file.csv','r') do |row|
#do something with the row, e.g. row['first_name']
end
Once you have extracted the fields from the CSV you can use something like this to generate a temporary password:
o = [('A'..'Z'), (1 .. 9)].map{|i| i.to_a}.flatten;
temp_password = (0..8).map{ o[rand(o.length)] }.join;
This will generate a password containing capital letters and numbers 1-9 with a length of 8 characters (i use this to generate invite codes in my current project)
So to put it all together you can do something like this:
CSV.open('my_file.csv','r') do |row|
email = row['email']
name = row['name']
#This would be better in a seperate method
o = [('A'..'Z'), (1 .. 9)].map{|i| i.to_a}.flatten;
temp_password = (0..8).map{ o[rand(o.length)] }.join;
User.create(:email => email, :password => temp_password, :password_confirmation => temp_password)
end
Hope that points you in the right direction!