Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Michael Sarlitt
Michael Sarlitt
3,140 Points

"Could not determine content-length of response body" error

I'm just getting started with Ruby and am trying to complete the "Generate a Rails Application" step.

I'm able to successfully create the treebook folder in Terminal, but when I run the rails server, I see the following message (last few lines):

Michaels-MacBook-Pro:treebook msarlitt$ rails server
=> Booting WEBrick
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-07-28 22:25:26] INFO  WEBrick 1.3.1
[2013-07-28 22:25:26] INFO  ruby 1.9.3 (2013-02-22) [x86_64-darwin10.8.0]
[2013-07-28 22:25:26] INFO  WEBrick::HTTPServer#start: pid=10474 port=3000
[2013-07-28 22:25:47] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true


Started GET "/assets/rails.png" for 127.0.0.1 at 2013-07-28 22:25:48 -0700
Connecting to database specified by database.yml
Served asset /rails.png - 304 Not Modified (1ms)
[2013-07-28 22:25:48] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
[2013-07-28 22:25:48] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

How do I resolve this error? Nothing else seems to work after this point. Please note that I'm a total newbie to programming and have never used Terminal before today.

2 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Michael Sarlitt,

You should be safe to ignore that warning. Are you able to visit the site in a web browser?

Our Rails teacher, Jason Seifer, might know more.

Michael Sarlitt
Michael Sarlitt
3,140 Points

Thanks Nick Pettit. I can access the site in a web browser at that point, but things break when I try to add a status update.

Jason Seifer here's what I'm doing in Terminal from the very beginning (this is for the "Generating a Rails App" stage):

  1. rvm use 1.9.3 -- success
  2. rails new treebook -- success
  3. cd treebook/ -- success
  4. rails server -- success, and I see the correct page at http://0.0.0.0:3000. When I check Terminal, I see the same successful code as shown in the video, but also see the chunked error above at the end.
  5. cntrl + c -- success (server is stopped)
  6. rails generate scaffold status name:string content:text -- success (I verified the directories were created)
  7. rake db:migrate -- success
  8. When I visit http://0.0.0.0:3000 or http://0.0.0.0:3000/statuses, I get an error page. Here's what Terminal spits out after I attempt to migrate the db in step #7:

unknownb8f6b11309ab:treebook msarlitt$ rake db:migrate == CreateStatuses: migrating ================================================= -- create_table(:statuses) -> 0.0011s == CreateStatuses: migrated (0.0011s) ========================================

Any ideas of what's going on? Pulling my hair out here ;)

Michael Sarlitt
Michael Sarlitt
3,140 Points

Oye, finally figured it out. I never started the server again with the "rails server" command before accessing the webpage. Thanks anyway for the help.

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

As Nick Pettit said, you can safely ignore that error. The short explanation is that it has to do with different versions of things and it really doesn't matter :)