Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming not working #2

Open
mattfordham opened this issue Mar 23, 2012 · 2 comments
Open

Streaming not working #2

mattfordham opened this issue Mar 23, 2012 · 2 comments

Comments

@mattfordham
Copy link

Here there. I can't seem to get streaming working in my Rails app on Heroku with Unicorn. I also tested locally with Foreman with no luck. I am using the same view code as is in the test app for this gem. The file download never initiates... it just spins while it cranks through the loop. I know this isn't much to go on, but is there anything I could be missing?

Controller:

  @streaming = true
  @filename = 'report.csv'
   respond_to do |format|
     format.csv
end

View:


10_000_000.times do |i|
   csv << ["this","is","a","scale","test",i.to_s]
end

Procfile:
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

Unicorn.rb

timeout 30         # restarts workers that hang for 30 seconds```
@mattfordham
Copy link
Author

Here's an update. I noticed that I have to use gem 'csv_streamer' not csv_builder. After switching that, I get the following when trying to start the server:

ERROR -- : uninitialized constant ActionView::Template::Handler (NameError) 11:49:54 web.1 | /Users/matt/.rvm/gems/ruby-1.9.2-p180/gems/csv_streamer-0.0.3/lib/csv_streamer/template_handler.rb:81:in module:CsvBuilder'
11:49:54 web.1 | /Users/matt/.rvm/gems/ruby-1.9.2-p180/gems/csv_streamer-0.0.3/lib/csv_streamer/template_handler.rb:3:in <top (required)>'

Any ideas? Thanks!

@mattfordham
Copy link
Author

OK, one more update :)

I cloned your test project for this gem, and it worked. I updated the Rails version on that to 3.2.2 and produced the same error I was getting before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant