Hi i have a Query like this to Download details as CSV and using MongoDb, Mongoid users.all.each do |user| csv << [user.id.to_s, user.profile.id, user.profile.status, user.profile.username, render_time(user.created_at), render_time(user.updated_at), render_time(user.checked_out_at), render_time(user.checked_in_at), user.result, user.state, user.language, user.content, user.score.to_s, users_url(user)] end But For instance, this is the tail of my local log when I export to csv 20000 users It Dies and i got a Empty csv file ,, Is there any recommended ways/suggestion to resolve this issue ? Thanks in advance :) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VROmkKgojbsJ. 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 22 November 2011 09:29, Rajeev Kannav Sharma <rajeevsharma86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi i have a Query like this to Download details as CSV and using MongoDb, > Mongoid > users.all.each do |user| > csv << [user.id.to_s, > user.profile.id, > user.profile.status, > user.profile.username, > render_time(user.created_at), > render_time(user.updated_at), > render_time(user.checked_out_at), > render_time(user.checked_in_at), > user.result, > user.state, > user.language, > user.content, > user.score.to_s, > users_url(user)] > end > > But For instance, this is the tail of my local log when I export to csv > 20000 users It Dies and i got a Empty csv file ,, > Is there any recommended ways/suggestion to resolve this issue ?You have not shown us the log. 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.
MONGODB database[''users''].find({:_id=>BSON::ObjectId(''4e97324912959c3296067674576500225'')}) Rendered users/index.csv.rcsv (103390.8ms) Completed 200 OK in 104969ms (Views: 103402.9ms) On Tue, Nov 22, 2011 at 3:19 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 22 November 2011 09:29, Rajeev Kannav Sharma > <rajeevsharma86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi i have a Query like this to Download details as CSV and using MongoDb, > > Mongoid > > users.all.each do |user| > > csv << [user.id.to_s, > > user.profile.id, > > user.profile.status, > > user.profile.username, > > render_time(user.created_at), > > render_time(user.updated_at), > > render_time(user.checked_out_at), > > render_time(user.checked_in_at), > > user.result, > > user.state, > > user.language, > > user.content, > > user.score.to_s, > > users_url(user)] > > end > > > > But For instance, this is the tail of my local log when I export to csv > > 20000 users It Dies and i got a Empty csv file ,, > > Is there any recommended ways/suggestion to resolve this issue ? > > You have not shown us the log. > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Rajeev Kannav Sharma<http://www.google.com/search?q=Rajeev+Kannav+Sharma&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a> -- 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 22 November 2011 10:41, rajeevsharma86 <rajeevsharma86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> MONGODB > database[''users''].find({:_id=>BSON::ObjectId(''4e97324912959c3296067674576500225'')}) > Rendered users/index.csv.rcsv (103390.8ms) > Completed 200 OK in 104969ms (Views: 103402.9ms)Please don''t top post, it makes it difficult to follow the thread, insert your reply at the appropriate points in the previous message. Thanks. You said that the application died, what makes you say that it died? Have you tried using ruby-debug to break into your code and inspect the data to see where it is going wrong? See the Rails Guide on debugging to find how to do that. Colin> > On Tue, Nov 22, 2011 at 3:19 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 22 November 2011 09:29, Rajeev Kannav Sharma >> <rajeevsharma86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > Hi i have a Query like this to Download details as CSV and using >> > MongoDb, >> > Mongoid >> > users.all.each do |user| >> > csv << [user.id.to_s, >> > user.profile.id, >> > user.profile.status, >> > user.profile.username, >> > render_time(user.created_at), >> > render_time(user.updated_at), >> > render_time(user.checked_out_at), >> > render_time(user.checked_in_at), >> > user.result, >> > user.state, >> > user.language, >> > user.content, >> > user.score.to_s, >> > users_url(user)] >> > end >> > >> > But For instance, this is the tail of my local log when I export to csv >> > 20000 users It Dies and i got a Empty csv file ,, >> > Is there any recommended ways/suggestion to resolve this issue ? >> >> You have not shown us the log. >> >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > Rajeev Kannav Sharma > > -- > 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. >-- gplus.to/clanlaw -- 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.