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

Generate a Rails Application

At the beginning of this video, we need to type the following into the command prompt: "rvm use 1.9.3". However, when I hit Enter, I get the following message in the Command Prompt:

'rvm' is not recognized as an internal or external command, operable program or batch file.

This is being done on a Windows PC. I had no problems doing this on a Mac. Is there a step that I am missing?

5 Answers

Paul - If you haven't already, install Rails using the instructions in the Installing Rails on Windows video.


Both the rvm and 0.0.0.0 only apply if you are working on a OS X or Linux.

On windows the way to start rails is to type rails s webbrick will then tell you the address it's starting on. By default you can access the rails web server webbrick on 127.0.0.1:3000.

Use CTRL-C you will stop the webbrick server.

Mac and Linux automatically come packaged with a version of Ruby, but Windows does not. 'rvm' is the Ruby Version Manager. You will have to install Ruby on Windows by some other means first.

Try RubyInstaller.

I have used the rails installer, and have verified that ruby and ruby on rails has been installed.

I skipped the "rvm" command, and typed in the two commands to create the treebook directory and to make a "rails new treebook".

When I type in "rails s" or "rails server", I get the following:

c:\CalNext\treebook>rails s => Booting WEBrick => Rails 3.2.13 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2013-04-29 12:39:03] INFO WEBrick 1.3.1 [2013-04-29 12:39:03] INFO ruby 1.9.3 (2013-02-22) [i386-mingw32] [2013-04-29 12:39:03] INFO WEBrick::HTTPServer#start: pid=4668 port=3000

When I type in the address given, I get a page that is titled "Network Error", and get the following message:

Network Error (tcp_error)

A communication error occurred: "" The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

For assistance, contact your network support team.

When I type ctrl+c to shut down the server, I get the following question that I don't see appearing in the videos:

Exiting Terminate batch job (Y/N)?

I've hit both "Yes" and "No". The server just won't come up!

Paul Dietrich - There are a few minor differences between OS X and Window, learning about them is all part of the joy of learning to program :tm:.

Like I said before, don't use the address http://0.0.0.0:3000 instead use http://127.0.0.1:3000 on Windows.

If it ask you to Terminate batch job just answer Y as that's the expected behavior on Windows. If you want to know more about this behavior, check this out it's the first link on Google.

Got it working. Thanks much!