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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Rails Application

Steven Worley
Steven Worley
3,615 Points

localhost:3000 "This webpage is not available."

bin/rails server

returned:

-bash: bin/rails: No such file or directory

So, I ran:

rails server

Which returned:

Usage: rails new APP_PATH [options]

Options:

-List of options truncated to take up less space.

Description: The 'rails new' command creates a new Rails application with a default directory structure and configuration at the path you specify.

You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.

Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.

Example: rails new ~/Code/Ruby/weblog

This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.

However, when I type in localhost:3000 into my browser, no connection is made. Any ideas what's happening here?

3 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Did you go into the folder and run bundle install after creating the new app using rails new odot?

Steven Worley
Steven Worley
3,615 Points

Nope, I did not. But when I ran rails new odot it automatically included this at the end run bundle install and said "Your bundle is now complete!"

I just tried to run bundle install anyway, which returned:

Could not locate Gemfile.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, but were you inside the directory of the project when running bundle install? Did you do cd odot? Because both problems seem to be caused by the fact that you run rails new and then rails server without switching directories in between :). Just please take no offense if this is something very obvious, I'm trying to find simplest possible solutions for now.

Steven Worley
Steven Worley
3,615 Points

Doh! I created my own ODOT folder without realizing that rails new odot would create one for me. Therefore, I thought I was in the right odot folder, not realizing I have two odot folders.

Thanks!

Charles-Eric Legras
Charles-Eric Legras
4,917 Points

I have this kind of message while running bin/rails server

charlou:odot Charlou$ bin/rails server => Booting WEBrick => Rails 4.0.2 application starting in development on http://0.0.0.0:3000 => Run rails server -h for more startup options => Ctrl-C to shutdown server [2015-02-16 17:43:38] INFO WEBrick 1.3.1 [2015-02-16 17:43:38] INFO ruby 2.0.0 (2014-05-08) [universal.x86_64-darwin14] [2015-02-16 17:43:38] WARN TCPServer Error: Address already in use - bind(2) Exiting /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:in initialize': Address already in use - bind(2) (Errno::EADDRINUSE) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:innew' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:85:in block in create_listeners' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:82:ineach' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/utils.rb:82:in create_listeners' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:132:inlisten' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:113:in initialize' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:45:ininitialize' from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:in new' from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:11:inrun' from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in start' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:instart' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in block in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:intap' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in <top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in `<main>'